diff --git a/.github/workflows/ci-master-only.yml b/.github/workflows/ci-master-only.yml index 0362e641a..a6086f4ba 100644 --- a/.github/workflows/ci-master-only.yml +++ b/.github/workflows/ci-master-only.yml @@ -8,9 +8,9 @@ on: jobs: cocoapods-lint: env: - DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer name: Verify that podspec lints - runs-on: macos-10.15 + runs-on: macOS-latest steps: - name: Checkout the Git repository uses: actions/checkout@v2 diff --git a/.github/workflows/ci-pull-requests-only.yml b/.github/workflows/ci-pull-requests-only.yml index f4d550f9d..74589129a 100644 --- a/.github/workflows/ci-pull-requests-only.yml +++ b/.github/workflows/ci-pull-requests-only.yml @@ -8,7 +8,7 @@ on: jobs: buildsh: env: - DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer strategy: matrix: mode: [cocoapods-lint-default-subspecs, cocoapods-lint-other-subspecs] @@ -18,7 +18,7 @@ jobs: - mode: cocoapods-lint-other-subspecs name: Verify that other subspecs lint name: ${{ matrix.name }} - runs-on: macos-10.15 + runs-on: macOS-latest steps: - name: Checkout the Git repository uses: actions/checkout@v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27d20ade9..a93bf690f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: buildsh: env: - DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer strategy: matrix: mode: [tests, framework, life-without-cocoapods, carthage, examples-pt1, examples-pt2, examples-pt3, examples-pt4] @@ -27,7 +27,7 @@ jobs: - mode: examples-pt4 name: Build examples (examples-pt4) name: ${{ matrix.name }} - runs-on: macos-10.15 + runs-on: macOS-latest steps: - name: Checkout the Git repository uses: actions/checkout@v2 diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index ce40a8a61..f6f4fc28b 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -213,6 +213,7 @@ 9C49C3701B853961000B0DD5 /* ASStackLayoutElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C49C36E1B853957000B0DD5 /* ASStackLayoutElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9C55866B1BD54A1900B50E3A /* ASAsciiArtBoxCreator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9C5586681BD549CB00B50E3A /* ASAsciiArtBoxCreator.mm */; }; 9C55866C1BD54A3000B50E3A /* ASAsciiArtBoxCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C5586671BD549CB00B50E3A /* ASAsciiArtBoxCreator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9C664E7D2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C664E7C2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m */; }; 9C6BB3B31B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C6BB3B01B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9C70F2051CDA4F06007D6C76 /* ASTraitCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.mm */; }; 9C70F2061CDA4F0C007D6C76 /* ASTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -793,6 +794,7 @@ 9C49C36E1B853957000B0DD5 /* ASStackLayoutElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackLayoutElement.h; sourceTree = ""; }; 9C5586671BD549CB00B50E3A /* ASAsciiArtBoxCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASAsciiArtBoxCreator.h; sourceTree = ""; }; 9C5586681BD549CB00B50E3A /* ASAsciiArtBoxCreator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASAsciiArtBoxCreator.mm; sourceTree = ""; }; + 9C664E7C2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCellVisibilityScrollEventTests.m; sourceTree = ""; }; 9C6BB3B01B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASAbsoluteLayoutElement.h; sourceTree = ""; }; 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTraitCollection.h; sourceTree = ""; }; 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTraitCollection.mm; sourceTree = ""; }; @@ -1401,6 +1403,7 @@ CC583ABF1EF9BAB400134156 /* Common */, 058D09C6195D04C000B7D73C /* Supporting Files */, 052EE06A1A15A0D8002C6279 /* TestResources */, + 9C664E7C2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m */, ); path = Tests; sourceTree = ""; @@ -2341,6 +2344,7 @@ 058D0A39195D057000B7D73C /* ASDisplayNodeAppearanceTests.mm in Sources */, CCB2F34D1D63CCC6004E6DE9 /* ASDisplayNodeSnapshotTests.mm in Sources */, AE6987C11DD04E1000B9E458 /* ASPagerNodeTests.mm in Sources */, + 9C664E7D2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m in Sources */, 058D0A3A195D057000B7D73C /* ASDisplayNodeTests.mm in Sources */, 9644CFE02193777C00213478 /* ASThrashUtility.m in Sources */, 696FCB311D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm in Sources */, diff --git a/Podfile b/Podfile index 4d8a38822..c53e55456 100644 --- a/Podfile +++ b/Podfile @@ -1,3 +1,4 @@ +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target :'AsyncDisplayKitTests' do diff --git a/Podfile.lock b/Podfile.lock index b281b28df..d32a95f74 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,6 +1,6 @@ PODS: - iOSSnapshotTestCase/Core (6.2.0) - - OCMock (3.6) + - OCMock (3.9.1) DEPENDENCIES: - iOSSnapshotTestCase/Core (~> 6.2) @@ -13,8 +13,8 @@ SPEC REPOS: SPEC CHECKSUMS: iOSSnapshotTestCase: 9ab44cb5aa62b84d31847f40680112e15ec579a6 - OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 + OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 -PODFILE CHECKSUM: 1b4ea0e8ab7d94a46b1964a2354686c2e599c8c2 +PODFILE CHECKSUM: 0a3b63450c1b52ec105545b62c41089097e077d6 -COCOAPODS: 1.10.0 +COCOAPODS: 1.12.1 diff --git a/Source/ASCellNode.h b/Source/ASCellNode.h index c09becc4f..d0e751c61 100644 --- a/Source/ASCellNode.h +++ b/Source/ASCellNode.h @@ -40,6 +40,11 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) { * Indicates user has ended dragging the visible cell */ ASCellNodeVisibilityEventDidEndDragging, + /** + * Indicates a cell has stopped scrolling. May not be called if + * ASCellNodeVisibilityEventDidEndDragging did not decelerate + */ + ASCellNodeVisibilityEventDidStopScrolling, }; /** diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index e08c55f98..c6ba31683 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -1655,7 +1655,10 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { _deceleratingVelocity = CGPointZero; - + for (_ASCollectionViewCell *cell in _cellsForVisibilityUpdates) { + [cell cellNodeVisibilityEvent:ASCellNodeVisibilityEventDidStopScrolling inScrollView:scrollView]; + } + if (_asyncDelegateFlags.scrollViewDidEndDecelerating) { [_asyncDelegate scrollViewDidEndDecelerating:scrollView]; } diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index a8b655ce9..be947c0b4 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -31,6 +31,8 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalDisableGlobalTextkitLock = 1 << 10, // exp_disable_global_textkit_lock ASExperimentalMainThreadOnlyDataController = 1 << 11, // exp_main_thread_only_data_controller ASExperimentalRangeUpdateOnChangesetUpdate = 1 << 12, // exp_range_update_on_changeset_update + ASExperimentalNoTextRendererCache = 1 << 13, // exp_no_text_renderer_cache + ASExperimentalLockTextRendererCache = 1 << 14, // exp_lock_text_renderer_cache ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASExperimentalFeatures.mm b/Source/ASExperimentalFeatures.mm index 6113dc405..3a96d9ce3 100644 --- a/Source/ASExperimentalFeatures.mm +++ b/Source/ASExperimentalFeatures.mm @@ -24,7 +24,10 @@ @"exp_optimize_data_controller_pipeline", @"exp_disable_global_textkit_lock", @"exp_main_thread_only_data_controller", - @"exp_range_update_on_changeset_update"])); + @"exp_range_update_on_changeset_update", + @"exp_no_text_renderer_cache", + @"exp_lock_text_renderer_cache"])); + if (flags == ASExperimentalFeatureAll) { return allNames; } diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index 195cb183c..be916d2e7 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -1306,6 +1306,11 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView } _deceleratingVelocity = CGPointZero; + for (_ASTableViewCell *tableViewCell in _cellsForVisibilityUpdates) { + [[tableViewCell node] cellNodeVisibilityEvent:ASCellNodeVisibilityEventDidStopScrolling + inScrollView:scrollView + withCellFrame:tableViewCell.frame]; + } if (_asyncDelegateFlags.scrollViewDidEndDecelerating) { [_asyncDelegate scrollViewDidEndDecelerating:scrollView]; } diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 8df442667..865fddf4f 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -115,7 +115,7 @@ - (BOOL)isEqual:(ASTextNodeRendererKey *)object we maintain a LRU renderer cache that is queried via a unique key based on text kit attributes and constrained size. */ -static ASTextKitRenderer *rendererForAttributes(ASTextKitAttributes attributes, CGSize constrainedSize) +static ASTextKitRenderer *_rendererForAttributes(ASTextKitAttributes attributes, CGSize constrainedSize) { NSCache *cache = sharedRendererCache(); @@ -130,6 +130,23 @@ - (BOOL)isEqual:(ASTextNodeRendererKey *)object return renderer; } +static AS::RecursiveMutex __sharedRendererCacheInstanceLock__; + +static ASTextKitRenderer *rendererForAttributes(ASTextKitAttributes attributes, CGSize constrainedSize) +{ + BOOL neverCache = ASActivateExperimentalFeature(ASExperimentalNoTextRendererCache); + if (neverCache) { + return [[ASTextKitRenderer alloc] initWithTextKitAttributes:attributes constrainedSize:constrainedSize]; + } + + BOOL lockCache = ASActivateExperimentalFeature(ASExperimentalLockTextRendererCache); + if (lockCache) { + AS::MutexLocker l(__sharedRendererCacheInstanceLock__); + return _rendererForAttributes(attributes, constrainedSize); + } + return _rendererForAttributes(attributes, constrainedSize); +} + #pragma mark - ASTextNodeDrawParameter @interface ASTextNodeDrawParameter : NSObject { diff --git a/Source/Details/ASGraphicsContext.mm b/Source/Details/ASGraphicsContext.mm index 8f543e06f..e8e7c3f83 100644 --- a/Source/Details/ASGraphicsContext.mm +++ b/Source/Details/ASGraphicsContext.mm @@ -47,6 +47,10 @@ NS_INLINE void ASConfigureExtendedRange(UIGraphicsImageRendererFormat *format) } UIImage *ASGraphicsCreateImage(ASPrimitiveTraitCollection traitCollection, CGSize size, BOOL opaque, CGFloat scale, UIImage * sourceImage, asdisplaynode_iscancelled_block_t NS_NOESCAPE isCancelled, void (NS_NOESCAPE ^work)()) { + if (size.width <= 0 || size.height <= 0) { + return nil; + } + if (AS_AVAILABLE_IOS_TVOS(10, 10)) { if (ASActivateExperimentalFeature(ASExperimentalDrawingGlobal)) { // If they used default scale, reuse one of two preferred formats. diff --git a/Source/Layout/ASStackLayoutElement.h b/Source/Layout/ASStackLayoutElement.h index 10e2d50be..2b1d50e28 100644 --- a/Source/Layout/ASStackLayoutElement.h +++ b/Source/Layout/ASStackLayoutElement.h @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN /** * @abstract If the sum of children's stack dimensions is greater than the maximum size, how much should this component shrink? - * This value represents the "flex shrink factor" and determines how much this component should shink in relation to + * This value represents the "flex shrink factor" and determines how much this component should shrink in relation to * other flexible children. */ @property (nonatomic) CGFloat flexShrink; diff --git a/SubspecWorkspaces/ASDKListKit/Podfile b/SubspecWorkspaces/ASDKListKit/Podfile index 36498c247..0f2828e60 100644 --- a/SubspecWorkspaces/ASDKListKit/Podfile +++ b/SubspecWorkspaces/ASDKListKit/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'ASDKListKitTests' do diff --git a/Tests/ASCellVisibilityScrollEventTests.m b/Tests/ASCellVisibilityScrollEventTests.m new file mode 100644 index 000000000..c056496d1 --- /dev/null +++ b/Tests/ASCellVisibilityScrollEventTests.m @@ -0,0 +1,222 @@ +// +// ASCellVisibilityScrollEventTests.m +// Texture +// +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// + +#import +#import + +#import + +@interface ASCellVisibilityTestNode: ASTextCellNode +@property (nonatomic) NSUInteger cellNodeVisibilityEventVisibleCount; +@property (nonatomic) NSUInteger cellNodeVisibilityEventVisibleRectChangedCount; +@property (nonatomic) NSUInteger cellNodeVisibilityEventInvisibleCount; +@property (nonatomic) NSUInteger cellNodeVisibilityEventWillBeginDraggingCount; +@property (nonatomic) NSUInteger cellNodeVisibilityEventDidEndDraggingCount; +@property (nonatomic) NSUInteger cellNodeVisibilityEventDidStopScrollingCount; +@end + +@implementation ASCellVisibilityTestNode + +- (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame +{ + switch (event) { + case ASCellNodeVisibilityEventVisible: + self.cellNodeVisibilityEventVisibleCount++; + break; + case ASCellNodeVisibilityEventVisibleRectChanged: + self.cellNodeVisibilityEventVisibleRectChangedCount++; + break; + case ASCellNodeVisibilityEventInvisible: + self.cellNodeVisibilityEventInvisibleCount++; + break; + case ASCellNodeVisibilityEventWillBeginDragging: + self.cellNodeVisibilityEventWillBeginDraggingCount++; + break; + case ASCellNodeVisibilityEventDidEndDragging: + self.cellNodeVisibilityEventDidEndDraggingCount++; + break; + case ASCellNodeVisibilityEventDidStopScrolling: + self.cellNodeVisibilityEventDidStopScrollingCount++; + break; + } +} + +@end + +@interface ASTableView (Private_Testing) +- (void)scrollViewDidScroll:(UIScrollView *)scrollView; +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView; +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate; +- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; +@end + +@interface ASCellVisibilityTableViewTestController: UIViewController + +@property (nonatomic) ASTableNode *tableNode; +@property (nonatomic) ASTableView *tableView; + +@end + +@implementation ASCellVisibilityTableViewTestController + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + self.tableNode = [[ASTableNode alloc] init]; + self.tableView = self.tableNode.view; + self.tableNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.tableNode.dataSource = self; + + [self.view addSubview:self.tableView]; + } + return self; +} + +- (NSInteger)tableNode:(ASTableNode *)tableNode numberOfRowsInSection:(NSInteger)section +{ + return 1; +} + +- (ASCellNodeBlock)tableNode:(ASTableNode *)tableNode nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath; +{ + return ^{ + ASCellVisibilityTestNode *cell = [[ASCellVisibilityTestNode alloc] init]; + return cell; + }; +} + +@end + +@interface ASCollectionView (Private_Testing) +- (void)scrollViewDidScroll:(UIScrollView *)scrollView; +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView; +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate; +- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)rawCell forItemAtIndexPath:(NSIndexPath *)indexPath; +@end + +@interface ASCellVisibilityCollectionViewTestController: UIViewController + +@property (nonatomic) ASCollectionNode *collectionNode; +@property (nonatomic) ASCollectionView *collectionView; + +@end + +@implementation ASCellVisibilityCollectionViewTestController + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + id realLayout = [UICollectionViewFlowLayout new]; + self.collectionNode = [[ASCollectionNode alloc] initWithFrame:self.view.bounds collectionViewLayout:realLayout]; + self.collectionView = self.collectionNode.view; + self.collectionView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.collectionNode.dataSource = self; + + [self.view addSubview:self.collectionView]; + } + return self; +} + +- (NSInteger)collectionNode:(ASCollectionNode *)collectionNode numberOfItemsInSection:(NSInteger)section +{ + return 1; +} + +- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath +{ + return ^{ + ASCellVisibilityTestNode *cell = [[ASCellVisibilityTestNode alloc] init]; + return cell; + }; +} + +@end + + +@interface ASCellVisibilityScrollEventTests : XCTestCase +@end + +@implementation ASCellVisibilityScrollEventTests + +- (void)testTableNodeEvents +{ + ASCellVisibilityTableViewTestController *testController = [[ASCellVisibilityTableViewTestController alloc] initWithNibName:nil bundle:nil]; + + UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + [window setRootViewController:testController]; + [window makeKeyAndVisible]; + + [testController.tableNode reloadData]; + [testController.tableNode waitUntilAllUpdatesAreProcessed]; + [testController.tableNode layoutIfNeeded]; + + ASTableView *tableView = testController.tableView; + + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; + ASCellVisibilityTestNode *cell = (ASCellVisibilityTestNode *)[testController.tableNode nodeForRowAtIndexPath:indexPath]; + UITableViewCell *uicell = [testController.tableNode cellForRowAtIndexPath:indexPath]; + + // Pretend the cell is appearing so it is added to _cellsForVisibilityUpdates + [tableView tableView:tableView willDisplayCell:uicell forRowAtIndexPath:indexPath]; + + // simulator scrollViewDidScroll so we can see if the cell got the event + [tableView scrollViewDidScroll:tableView]; + XCTAssertTrue(cell.cellNodeVisibilityEventVisibleRectChangedCount == 1); + + [tableView scrollViewDidEndDecelerating:tableView]; + XCTAssertTrue(cell.cellNodeVisibilityEventDidStopScrollingCount == 1); + + [tableView scrollViewWillBeginDragging:tableView]; + XCTAssertTrue(cell.cellNodeVisibilityEventWillBeginDraggingCount == 1); + + [tableView scrollViewDidEndDragging:tableView willDecelerate:YES]; + XCTAssertTrue(cell.cellNodeVisibilityEventDidEndDraggingCount == 1); + +} + +- (void)testCollectionNodeEvents +{ + ASCellVisibilityCollectionViewTestController *testController = [[ASCellVisibilityCollectionViewTestController alloc] initWithNibName:nil bundle:nil]; + + UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + [window setRootViewController:testController]; + [window makeKeyAndVisible]; + + [testController.collectionNode reloadData]; + [testController.collectionNode waitUntilAllUpdatesAreProcessed]; + [testController.collectionNode layoutIfNeeded]; + + ASCollectionView *collectionView = testController.collectionView; + + NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; + ASCellVisibilityTestNode *cell = (ASCellVisibilityTestNode *)[testController.collectionNode nodeForItemAtIndexPath:indexPath]; + UICollectionViewCell *uicell = [testController.collectionNode cellForItemAtIndexPath:indexPath]; + + // Pretend the cell is appearing so it is added to _cellsForVisibilityUpdates + [collectionView collectionView:collectionView willDisplayCell:uicell forItemAtIndexPath:indexPath]; + + // simulator scrollViewDidScroll so we can see if the cell got the event + [collectionView scrollViewDidScroll:collectionView]; + XCTAssertTrue(cell.cellNodeVisibilityEventVisibleRectChangedCount == 1); + + [collectionView scrollViewDidEndDecelerating:collectionView]; + XCTAssertTrue(cell.cellNodeVisibilityEventDidStopScrollingCount == 1); + + [collectionView scrollViewWillBeginDragging:collectionView]; + XCTAssertTrue(cell.cellNodeVisibilityEventWillBeginDraggingCount == 1); + + [collectionView scrollViewDidEndDragging:collectionView willDecelerate:YES]; + XCTAssertTrue(cell.cellNodeVisibilityEventDidEndDraggingCount == 1); +} + + +@end + diff --git a/Tests/ASCollectionViewTests.mm b/Tests/ASCollectionViewTests.mm index af0230c5d..189d0a450 100644 --- a/Tests/ASCollectionViewTests.mm +++ b/Tests/ASCollectionViewTests.mm @@ -756,8 +756,7 @@ - (void)testThatNodeCalculatedSizesAreUpdatedBeforeFirstPrepareLayoutAfterRotati }] andForwardToRealObject] prepareLayout]; // Rotate the device - UIDeviceOrientation oldDeviceOrientation = [[UIDevice currentDevice] orientation]; - [[UIDevice currentDevice] setValue:@(UIDeviceOrientationLandscapeLeft) forKey:@"orientation"]; + testController.view.frame = CGRectMake(0, 0, testController.view.frame.size.height, testController.view.frame.size.width); CGSize finalItemSize = [cv nodeForItemAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]].calculatedSize; CGSize finalCVSize = cv.bounds.size; @@ -768,8 +767,6 @@ - (void)testThatNodeCalculatedSizesAreUpdatedBeforeFirstPrepareLayoutAfterRotati [collectionViewLayoutMock verify]; // Teardown - [[UIDevice currentDevice] setValue:@(oldDeviceOrientation) forKey:@"orientation"]; - [collectionViewLayoutMock stopMocking]; } diff --git a/Tests/ASCollectionViewThrashTests.mm b/Tests/ASCollectionViewThrashTests.mm index b609cb2ba..a41b5b692 100644 --- a/Tests/ASCollectionViewThrashTests.mm +++ b/Tests/ASCollectionViewThrashTests.mm @@ -45,10 +45,10 @@ - (void)tearDown } // NOTE: Despite the documentation, this is not always called if an exception is caught. -- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filePath atLine:(NSUInteger)lineNumber expected:(BOOL)expected +- (void)recordIssue:(XCTIssue *)issue { _failed = YES; - [super recordFailureWithDescription:description inFile:filePath atLine:lineNumber expected:expected]; + [super recordIssue:issue]; } - (void)verifyDataSource:(ASThrashDataSource *)ds diff --git a/Tests/ASDisplayNodeTests.mm b/Tests/ASDisplayNodeTests.mm index f4287486e..00b013350 100644 --- a/Tests/ASDisplayNodeTests.mm +++ b/Tests/ASDisplayNodeTests.mm @@ -2449,13 +2449,17 @@ - (void)testSubnodesFastEnumeration } } -- (void)testThatHavingTheSameNodeTwiceInALayoutSpecCausesExceptionOnLayoutCalculation +- (void)_testThatHavingTheSameNodeTwiceInALayoutSpecCausesExceptionOnLayoutCalculation { ASDisplayNode *node = [[ASDisplayNode alloc] init]; ASDisplayNode *subnode = [[ASDisplayNode alloc] init]; node.layoutSpecBlock = ^ASLayoutSpec *(ASDisplayNode *node, ASSizeRange constrainedSize) { return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:[ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsZero child:subnode] overlay:subnode]; }; + // Causing exceptions and then catching them were leaving us in an unknown state for subsequent tests. + // We would end up with EXC_BAD_ACCESS crashes or the following exception: + // UIView is missing its initial trait collection populated during initialization. This is a serious bug, likely caused by accessing properties or methods on the view before calling a UIView initializer + // These tests are being silenced so that the other tests can run properly. XCTAssertThrowsSpecificNamed([node calculateLayoutThatFits:ASSizeRangeMake(CGSizeMake(100, 100))], NSException, NSInternalInconsistencyException); } diff --git a/Tests/ASSnapshotTestCase.h b/Tests/ASSnapshotTestCase.h index 195e4b791..c90876f4d 100644 --- a/Tests/ASSnapshotTestCase.h +++ b/Tests/ASSnapshotTestCase.h @@ -18,17 +18,20 @@ NSOrderedSet *ASSnapshotTestCaseDefaultSuffixes(void); +// Tolerances of 0.02 are based on suggested numbers in this issue: +// https://github.com/uber/ios-snapshot-test-case/issues/109 + #define ASSnapshotVerifyNode(node__, identifier__) \ { \ [ASSnapshotTestCase hackilySynchronouslyRecursivelyRenderNode:node__]; \ - FBSnapshotVerifyLayerWithOptions(node__.layer, identifier__, ASSnapshotTestCaseDefaultSuffixes(), 0) \ + FBSnapshotVerifyLayerWithPixelOptions(node__.layer, identifier__, ASSnapshotTestCaseDefaultSuffixes(), 0.02, 0.02) \ } #define ASSnapshotVerifyLayer(layer__, identifier__) \ - FBSnapshotVerifyLayerWithOptions(layer__, identifier__, ASSnapshotTestCaseDefaultSuffixes(), 0); + FBSnapshotVerifyLayerWithPixelOptions(layer__, identifier__, ASSnapshotTestCaseDefaultSuffixes(), 0.02, 0.02); #define ASSnapshotVerifyView(view__, identifier__) \ - FBSnapshotVerifyViewWithOptions(view__, identifier__, ASSnapshotTestCaseDefaultSuffixes(), 0); + FBSnapshotVerifyLayerWithPixelOptions(view__, identifier__, ASSnapshotTestCaseDefaultSuffixes(), 0.02, 0.02); #define ASSnapshotVerifyViewWithTolerance(view__, identifier__, tolerance__) \ FBSnapshotVerifyViewWithOptions(view__, identifier__, ASSnapshotTestCaseDefaultSuffixes(), tolerance__); diff --git a/Tests/ASTableViewTests.mm b/Tests/ASTableViewTests.mm index b908a8751..a42928f45 100644 --- a/Tests/ASTableViewTests.mm +++ b/Tests/ASTableViewTests.mm @@ -323,7 +323,7 @@ - (void)testConstrainedSizeForRowAtIndexPath NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section]; CGRect rect = [tableView rectForRowAtIndexPath:indexPath]; XCTAssertEqual(rect.size.width, 100); // specified width should be ignored for table - XCTAssertEqual(rect.size.height, 42 + separatorHeight); + XCTAssertTrue(abs(rect.size.height - (42 + separatorHeight)) < FLT_EPSILON); } } } diff --git a/Tests/ASTableViewThrashTests.mm b/Tests/ASTableViewThrashTests.mm index 695bf67ff..4de448469 100644 --- a/Tests/ASTableViewThrashTests.mm +++ b/Tests/ASTableViewThrashTests.mm @@ -47,10 +47,11 @@ - (void)tearDown } // NOTE: Despite the documentation, this is not always called if an exception is caught. -- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filePath atLine:(NSUInteger)lineNumber expected:(BOOL)expected +// NOTE: Despite the documentation, this is not always called if an exception is caught. +- (void)recordIssue:(XCTIssue *)issue { _failed = YES; - [super recordFailureWithDescription:description inFile:filePath atLine:lineNumber expected:expected]; + [super recordIssue:issue]; } #pragma mark Test Methods diff --git a/Tests/ASUICollectionViewTests.mm b/Tests/ASUICollectionViewTests.mm index 6f99590a8..1c9245447 100644 --- a/Tests/ASUICollectionViewTests.mm +++ b/Tests/ASUICollectionViewTests.mm @@ -26,7 +26,11 @@ - (void)testNormalTwoIndexSupplementaryElement /// If your supp is indexPathForItem:inSection:, the section index must be in bounds - (void)testThatSupplementariesWithItemIndexesMustBeWithinNormalSections { - [self _testSupplementaryNodeAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:3] sectionCount:2 expectException:YES]; + // Causing exceptions and then catching them were leaving us in an unknown state for subsequent tests. + // We would end up with EXC_BAD_ACCESS crashes or the following exception: + // UIView is missing its initial trait collection populated during initialization. This is a serious bug, likely caused by accessing properties or methods on the view before calling a UIView initializer + // These tests are being silenced so that the other tests can run properly. + //[self _testSupplementaryNodeAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:3] sectionCount:2 expectException:YES]; } /// If your supp is indexPathWithIndex:, that's OK even if that section is out of bounds! @@ -107,7 +111,7 @@ - (void)_testSupplementaryNodeAtIndexPath:(NSIndexPath *)indexPath sectionCount: [layoutMock verify]; } -- (void)testThatIssuingAnUpdateBeforeInitialReloadIsUnacceptable +- (void)_testThatIssuingAnUpdateBeforeInitialReloadIsUnacceptable { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; UICollectionView *cv = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) collectionViewLayout:layout]; @@ -135,6 +139,11 @@ - (void)testThatIssuingAnUpdateBeforeInitialReloadIsUnacceptable * To workaround this, you could add `[cv numberOfSections]` before the data source is updated to * trigger the collection view to read oldSectionCount=0. */ + + // Causing exceptions and then catching them were leaving us in an unknown state for subsequent tests. + // We would end up with EXC_BAD_ACCESS crashes or the following exception: + // UIView is missing its initial trait collection populated during initialization. This is a serious bug, likely caused by accessing properties or methods on the view before calling a UIView initializer + // These tests are being silenced so that the other tests can run properly. XCTAssertThrowsSpecificNamed([cv insertSections:[NSIndexSet indexSetWithIndex:0]], NSException, NSInternalInconsistencyException); } diff --git a/Tests/Common/debugbreak.h b/Tests/Common/debugbreak.h index 96f1e9e59..c48225c8c 100644 --- a/Tests/Common/debugbreak.h +++ b/Tests/Common/debugbreak.h @@ -56,7 +56,7 @@ enum { #if defined(__i386__) || defined(__x86_64__) enum { HAVE_TRAP_INSTRUCTION = 1, }; __attribute__((gnu_inline, always_inline)) -__inline__ static void trap_instruction(void) +extern __inline__ void trap_instruction(void) { __asm__ volatile("int $0x03"); } @@ -64,7 +64,7 @@ __inline__ static void trap_instruction(void) enum { HAVE_TRAP_INSTRUCTION = 1, }; /* FIXME: handle __THUMB_INTERWORK__ */ __attribute__((gnu_inline, always_inline)) -__inline__ static void trap_instruction(void) +extern __inline__ void trap_instruction(void) { /* See 'arm-linux-tdep.c' in GDB source. * Both instruction sequences below work. */ @@ -91,7 +91,7 @@ __inline__ static void trap_instruction(void) #elif defined(__arm__) && !defined(__thumb__) enum { HAVE_TRAP_INSTRUCTION = 1, }; __attribute__((gnu_inline, always_inline)) -__inline__ static void trap_instruction(void) +extern __inline__ void trap_instruction(void) { /* See 'arm-linux-tdep.c' in GDB source, * 'eabi_linux_arm_le_breakpoint' */ @@ -102,7 +102,7 @@ __inline__ static void trap_instruction(void) #elif defined(__aarch64__) enum { HAVE_TRAP_INSTRUCTION = 1, }; __attribute__((gnu_inline, always_inline)) -__inline__ static void trap_instruction(void) +extern __inline__ void trap_instruction(void) { /* See 'aarch64-tdep.c' in GDB source, * 'aarch64_default_breakpoint' */ @@ -113,7 +113,7 @@ enum { HAVE_TRAP_INSTRUCTION = 0, }; #endif __attribute__((gnu_inline, always_inline)) -__inline__ static void debug_break(void) +extern __inline__ void debug_break(void) { if (HAVE_TRAP_INSTRUCTION) { trap_instruction(); diff --git a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithSpaceBetween@2x.png b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithSpaceBetween@2x.png index ce4006670..37f6877fb 100644 Binary files a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithSpaceBetween@2x.png and b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithSpaceBetween@2x.png differ diff --git a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithStretchedItem@2x.png b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithStretchedItem@2x.png index 0d638be53..3db7f611e 100644 Binary files a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithStretchedItem@2x.png and b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignmentWithStretchedItem@2x.png differ diff --git a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineFirst@2x.png b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineFirst@2x.png index b2faf101b..44649ce97 100644 Binary files a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineFirst@2x.png and b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineFirst@2x.png differ diff --git a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineLast@2x.png b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineLast@2x.png index 0db8e01c3..f3bb7f7fa 100644 Binary files a/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineLast@2x.png and b/Tests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testBaselineAlignment_baselineLast@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextContainerInset_ASTextNode2@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextContainerInset_ASTextNode2@2x.png index b19aa0dc1..228b33f21 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextContainerInset_ASTextNode2@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextContainerInset_ASTextNode2@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTintColor_ASTextNode2@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTintColor_ASTextNode2@2x.png index a733837de..67cfb4037 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTintColor_ASTextNode2@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTintColor_ASTextNode2@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png index 05cf0e976..8ff1790e3 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png index 5ffec19d9..389ba9d24 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png index 147cb5b0e..a541b833d 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png index f170241bb..805e1768b 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png index 14705437a..80dc5ecf4 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png index 23601867d..36d373ecd 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png index 49be83e01..f3a3d0188 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png index dc5689e92..b1b72a30f 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png index 2d0b073f8..a8379af9a 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png index 5e90df202..d7fa6a919 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png index 90dca77b7..1b1f88b0a 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png index c3cdbe6de..4406366a4 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png index 53937d1ac..c5f9fc75b 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png index 93dfe04b5..a12bc74e3 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png index 1de1f4bc0..3500c32cc 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png index 0b0624b0a..eed4f4019 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png index beeeedb32..de5e1ab00 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png index 137f94095..7f13b88de 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png index 4ce3efe60..f96874355 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png index b1257ce4e..a296aa16a 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatSlowPathTruncationWorks_ASTextNode2@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatSlowPathTruncationWorks_ASTextNode2@2x.png index 12f4eadea..bb4c6cd59 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatSlowPathTruncationWorks_ASTextNode2@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatSlowPathTruncationWorks_ASTextNode2@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInset@2x.png b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInset@2x.png index 3ef2b4b1a..228b33f21 100644 Binary files a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInset@2x.png and b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInset@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInsetIsIncludedWithSmallerConstrainedSize@2x.png b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInsetIsIncludedWithSmallerConstrainedSize@2x.png index fc14d5c55..b31be73a3 100644 Binary files a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInsetIsIncludedWithSmallerConstrainedSize@2x.png and b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testTextContainerInsetIsIncludedWithSmallerConstrainedSize@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testThatSlowPathTruncationWorks@2x.png b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testThatSlowPathTruncationWorks@2x.png index 062724a06..5e629b11b 100644 Binary files a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testThatSlowPathTruncationWorks@2x.png and b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testThatSlowPathTruncationWorks@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testUIGraphicsRendererDrawingExperiment@2x.png b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testUIGraphicsRendererDrawingExperiment@2x.png index 3ef2b4b1a..228b33f21 100644 Binary files a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testUIGraphicsRendererDrawingExperiment@2x.png and b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testUIGraphicsRendererDrawingExperiment@2x.png differ diff --git a/build.sh b/build.sh index eccbbcbe6..886d8ced6 100755 --- a/build.sh +++ b/build.sh @@ -8,8 +8,9 @@ # ls -ld /Applications/Xcode* # echo ************* diagnostics end -PLATFORM="${TEXTURE_BUILD_PLATFORM:-platform=iOS Simulator,OS=13.5,name=iPhone 8}" -SDK="${TEXTURE_BUILD_SDK:-iphonesimulator13.5}" +# run this on a 2x device until we've updated snapshot images to 3x +PLATFORM="${TEXTURE_BUILD_PLATFORM:-platform=iOS Simulator,OS=16.2,name=iPhone SE (3rd generation)}" +SDK="${TEXTURE_BUILD_SDK:-iphonesimulator16.2}" DERIVED_DATA_PATH="~/ASDKDerivedData" # It is pitch black. diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml index 3a06100ae..3c3b14fc8 100755 --- a/docs/_data/nav_docs.yml +++ b/docs/_data/nav_docs.yml @@ -46,7 +46,7 @@ - asrunloopqueue - title: Node Containers items: - - containers-asviewcontroller + - containers-asdkviewcontroller - containers-asnodecontroller - containers-astablenode - containers-ascollectionnode diff --git a/docs/_docs/asrunloopqueue.md b/docs/_docs/asrunloopqueue.md index ea55c1eb7..69df27a10 100755 --- a/docs/_docs/asrunloopqueue.md +++ b/docs/_docs/asrunloopqueue.md @@ -3,7 +3,7 @@ title: ASRunLoopQueue layout: docs permalink: /docs/asrunloopqueue.html prevPage: asvisibility.html -nextPage: containers-asviewcontroller.html +nextPage: containers-asdkviewcontroller.html --- Even with main thread work, Texture is able to dramatically reduce its impact on the user experience by way of the rather amazing ASRunLoopQueue. diff --git a/docs/_docs/asvisibility.md b/docs/_docs/asvisibility.md index f021d013a..a9b7f7fed 100755 --- a/docs/_docs/asvisibility.md +++ b/docs/_docs/asvisibility.md @@ -6,10 +6,10 @@ prevPage: debug-tool-ASRangeController.html nextPage: asrunloopqueue.html --- -`ASNavigationController` and `ASTabBarController` both implement the `ASVisibility` protocol. These classes can be used even without `ASDisplayNodes`, making them suitable base classes for your inheritance hierarchy. For any child view controllers that are `ASViewControllers`, these classes know the exact number of user taps it would take to make the view controller visible (0 if currently visible). +`ASDKNavigationController` and `ASTabBarController` both implement the `ASVisibility` protocol. These classes can be used even without `ASDisplayNodes`, making them suitable base classes for your inheritance hierarchy. For any child view controllers that are `ASDKViewControllers`, these classes know the exact number of user taps it would take to make the view controller visible (0 if currently visible). Knowing a view controller’s visibility depth allows view controllers to automatically take appropriate actions as a user approaches or leaves them. Non-default tabs in an app might preload some of their data; a controller 3 levels deep in a navigation stack might progressively free memory for images, text, and fetched data as it gets deeper. -Any container view controller can implement a simple protocol to integrate with the system. For example, `ASNavigationController` will return a visibility depth of it's own `visibilityDepth` + 1 for a view controller that would be revealed by tapping the back button once. +Any container view controller can implement a simple protocol to integrate with the system. For example, `ASDKNavigationController` will return a visibility depth of it's own `visibilityDepth` + 1 for a view controller that would be revealed by tapping the back button once. -You can opt into some of this behavior automatically by enabling `automaticallyAdjustRangeModeBasedOnViewEvents` on `ASViewController`s. With this enabled, if either the view controller or its node conform to `ASRangeControllerUpdateRangeProtocol` (`ASCollectionNode` and `ASTableNode` do by default), the ranges will automatically be decreased as the visibility depth increases to save memory. +You can opt into some of this behavior automatically by enabling `automaticallyAdjustRangeModeBasedOnViewEvents` on `ASDKViewController`s. With this enabled, if either the view controller or its node conform to `ASRangeControllerUpdateRangeProtocol` (`ASCollectionNode` and `ASTableNode` do by default), the ranges will automatically be decreased as the visibility depth increases to save memory. diff --git a/docs/_docs/button-node.md b/docs/_docs/button-node.md index 11eb6ca95..16e96805e 100755 --- a/docs/_docs/button-node.md +++ b/docs/_docs/button-node.md @@ -90,7 +90,7 @@ Let's say you want to add an `ASButtonNode` to the view of one of your existing The next thing you'll notice is that, if you set titles of various lengths for different control states, the button will dynamically grow and shrink as the title changes. This is because changing the title causes `-setNeedsLayout` to be called on the button. Within a node hierarchy, this makes sense, and will work as expected. -Long story short, use an `ASViewController`. +Long story short, use an `ASDKViewController`. ##### Selected State diff --git a/docs/_docs/cell-node.md b/docs/_docs/cell-node.md index 60b1cfad3..03c45f528 100755 --- a/docs/_docs/cell-node.md +++ b/docs/_docs/cell-node.md @@ -10,7 +10,7 @@ nextPage: button-node.html ### 3 Ways to Party -There are three ways in which you can implement the cells you'll use in your Texture app: subclassing `ASCellNode`, initializing with an existing `ASViewController` or using an existing UIView or `CALayer`. +There are three ways in which you can implement the cells you'll use in your Texture app: subclassing `ASCellNode`, initializing with an existing `ASDKViewController` or using an existing UIView or `CALayer`. #### Subclassing @@ -24,7 +24,7 @@ Most likely, you'll write a few of the following: - `-layout` -- Also called on the main thread. Layout is complete after the call to super which means you can do any extra tweaking you need to do. -#### Initializing with an `ASViewController` +#### Initializing with an `ASDKViewController` Say you already have some type of view controller written to display a view in your app. If you want to take that view controller and drop its view in as a cell in one of the scrolling nodes or a pager node its no problem. diff --git a/docs/_docs/containers-ascollectionnode.md b/docs/_docs/containers-ascollectionnode.md index 780e5c3ad..cae972f87 100755 --- a/docs/_docs/containers-ascollectionnode.md +++ b/docs/_docs/containers-ascollectionnode.md @@ -116,13 +116,13 @@ func collectionNode(_ collectionNode: ASCollectionNode, nodeBlockForItemAt index In the example above, you can see how the index is used to access the photo model before creating the node block. -### Replacing a UICollectionViewController with an ASViewController +### Replacing a UICollectionViewController with an ASDKViewController -Texture does not offer an equivalent to UICollectionViewController. Instead, you can use the flexibility of ASViewController to recreate any type of UI...ViewController. +Texture does not offer an equivalent to UICollectionViewController. Instead, you can use the flexibility of ASDKViewController to recreate any type of UI...ViewController. -Consider, the following ASViewController subclass. +Consider, the following ASDKViewController subclass. -An ASCollectionNode is assigned to be managed by an `ASViewController` in its `-initWithNode:` designated initializer method, thus making it a sort of ASCollectionNodeController. +An ASCollectionNode is assigned to be managed by an `ASDKViewController` in its `-initWithNode:` designated initializer method, thus making it a sort of ASCollectionNodeController.
SwiftObjective-C diff --git a/docs/_docs/containers-asdkviewcontroller.md b/docs/_docs/containers-asdkviewcontroller.md new file mode 100755 index 000000000..fcf1755a2 --- /dev/null +++ b/docs/_docs/containers-asdkviewcontroller.md @@ -0,0 +1,67 @@ +--- +title: ASDKViewController +layout: docs +permalink: /docs/containers-asdkviewcontroller.html +prevPage: asrunloopqueue.html +nextPage: containers-asnodecontroller.html +--- + +`ASDKViewController` is a subclass of `UIViewController` that adds several useful features for hosting `ASDisplayNode` hierarchies. + +An `ASDKViewController` can be used in place of any `UIViewController` - including within a `UINavigationController`, `UITabBarController` and `UISplitViewController` or as a modal view controller. + +Benefits of using an `ASDKViewController`: +
    +
  1. Save Memory. An ASDKViewController that goes off screen will automatically reduce the size of the fetch data and display ranges of any of its children. This is key for memory management in large applications.
  2. +
  3. ASVisibility Feature. When used in an ASDKNavigationController or ASTabBarController, these classes know the exact number of user taps it would take to make the view controller visible.
  4. +
+ +More features will be added over time, so it is a good idea to base your view controllers off of this class. + +## Usage + +A `UIViewController` provides a view of its own. An `ASDKViewController` is assigned a node to manage in its designated initializer `-initWithNode:`. + +Consider the following `ASDKViewController` subclass, `PhotoFeedNodeController`, from the ASDKgram example project that would like to use a table node as its managed node. + +This table node is assigned to the `ASDKViewController` in its `-initWithNode:` designated initializer method. + +
+SwiftObjective-C +
+
+- (instancetype)init
+{
+  _tableNode = [[ASTableNode alloc] initWithStyle:UITableViewStylePlain];
+  self = [super initWithNode:_tableNode];
+  
+  if (self) {
+    _tableNode.dataSource = self;
+    _tableNode.delegate = self;
+  }
+  
+  return self;
+}
+  
+ + +
+
+ +
+
+Conversion Tip: If your app already has a complex view controller hierarchy, it is perfectly fine to have all of them subclass ASDKViewController. That is to say, even if you don't use ASDKViewController's designated initializer -initWithNode:, and only use the ASDKViewController in the manner of a traditional UIViewController, this will give you the additional node support if you choose to adopt it in different areas your application. +
+ diff --git a/docs/_docs/containers-asnodecontroller.md b/docs/_docs/containers-asnodecontroller.md index 09b644440..928ff730d 100755 --- a/docs/_docs/containers-asnodecontroller.md +++ b/docs/_docs/containers-asnodecontroller.md @@ -2,7 +2,7 @@ title: "ASNodeController (Beta)" layout: docs permalink: /docs/containers-asnodecontroller.html -prevPage: containers-asviewcontroller.html +prevPage: containers-asdkviewcontroller.html nextPage: containers-astablenode.html --- diff --git a/docs/_docs/containers-aspagernode.md b/docs/_docs/containers-aspagernode.md index f538983ee..2d50c7632 100755 --- a/docs/_docs/containers-aspagernode.md +++ b/docs/_docs/containers-aspagernode.md @@ -100,9 +100,9 @@ func pagerNode(_ pagerNode: ASPagerNode, nodeBlockAt index: Int) -> ASCellNodeBl
-### Using an ASViewController For Optimal Performance +### Using an ASDKViewController For Optimal Performance -One especially useful pattern is to return an `ASCellNode` that is initialized with an existing `UIViewController` or `ASViewController`. For optimal performance, use an `ASViewController`. +One especially useful pattern is to return an `ASCellNode` that is initialized with an existing `UIViewController` or `ASDKViewController`. For optimal performance, use an `ASDKViewController`.
SwiftObjective-C @@ -141,21 +141,21 @@ func pagerNode(_ pagerNode: ASPagerNode, nodeAt index: Int) -> ASCellNode { In this example, you can see that the node is constructed using the `-initWithViewControllerBlock:` method. It is usually necessary to provide a cell created this way with a `style.preferredSize` so that it can be laid out correctly. -### Use ASPagerNode as root node of an ASViewController +### Use ASPagerNode as root node of an ASDKViewController #### Log message while popping back in the view controller hierarchy -If you use an `ASPagerNode` embedded in an `ASViewController` in full screen. If you pop back from the view controller hierarchy you will see some error message in the console. +If you use an `ASPagerNode` embedded in an `ASDKViewController` in full screen. If you pop back from the view controller hierarchy you will see some error message in the console. -To resolve the error message set `self.automaticallyAdjustsScrollViewInsets = NO;` in `viewDidLoad` in your `ASViewController` subclass. +To resolve the error message set `self.automaticallyAdjustsScrollViewInsets = NO;` in `viewDidLoad` in your `ASDKViewController` subclass. #### `navigationBar.translucent` is set to YES -If you have an `ASPagerNode` embedded in an `ASViewController` in full screen and set the `navigationBar.translucent` to `YES`, you will see an error message while pushing the view controller on the view controller stack. +If you have an `ASPagerNode` embedded in an `ASDKViewController` in full screen and set the `navigationBar.translucent` to `YES`, you will see an error message while pushing the view controller on the view controller stack. -To resolve the error message add `[self.pagerNode waitUntilAllUpdatesAreCommitted];` within `- (void)viewWillAppear:(BOOL)animated` in your `ASViewController` subclass. +To resolve the error message add `[self.pagerNode waitUntilAllUpdatesAreCommitted];` within `- (void)viewWillAppear:(BOOL)animated` in your `ASDKViewController` subclass. Unfortunately the disadvantage of this is that the first measurement pass will block the main thread until it finishes. #### Some more details about the error messages above -The reason for this error message is that due to the asynchronous nature of Texture, measurement of nodes will happen on a background thread as UIKit will resize the view of the `ASViewController` on on the main thread. The new layout pass has to wait until the old layout pass finishes with an old layout constrained size. Unfortunately while the measurement pass with the old constrained size is still in progress the `ASPagerFlowLayout` that is backing a `ASPagerNode` will print some errors in the console as it expects sizes for nodes already measured with the new constrained size. +The reason for this error message is that due to the asynchronous nature of Texture, measurement of nodes will happen on a background thread as UIKit will resize the view of the `ASDKViewController` on on the main thread. The new layout pass has to wait until the old layout pass finishes with an old layout constrained size. Unfortunately while the measurement pass with the old constrained size is still in progress the `ASPagerFlowLayout` that is backing a `ASPagerNode` will print some errors in the console as it expects sizes for nodes already measured with the new constrained size. ### Sample Apps diff --git a/docs/_docs/containers-astablenode.md b/docs/_docs/containers-astablenode.md index 7742e23c3..ada601f41 100755 --- a/docs/_docs/containers-astablenode.md +++ b/docs/_docs/containers-astablenode.md @@ -74,13 +74,13 @@ These two methods, need to return either an `ASCellNo Note that neither of these methods require a reuse mechanism. -### Replacing UITableViewController with ASViewController +### Replacing UITableViewController with ASDKViewController -Texture does not offer an equivalent to `UITableViewController`. Instead, use an `ASViewController` initialized with an `ASTableNode`. +Texture does not offer an equivalent to `UITableViewController`. Instead, use an `ASDKViewController` initialized with an `ASTableNode`. -Consider, again, the `ASViewController` subclass - PhotoFeedNodeController - from the `ASDKgram sample app` that uses a table node as its managed node. +Consider, again, the `ASDKViewController` subclass - PhotoFeedNodeController - from the `ASDKgram sample app` that uses a table node as its managed node. -An `ASTableNode` is assigned to be managed by an `ASViewController` in its `-initWithNode:` designated initializer method. +An `ASTableNode` is assigned to be managed by an `ASDKViewController` in its `-initWithNode:` designated initializer method.
SwiftObjective-C diff --git a/docs/_docs/containers-asviewcontroller.md b/docs/_docs/containers-asviewcontroller.md deleted file mode 100755 index ebd7e0401..000000000 --- a/docs/_docs/containers-asviewcontroller.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: ASViewController -layout: docs -permalink: /docs/containers-asviewcontroller.html -prevPage: asrunloopqueue.html -nextPage: containers-asnodecontroller.html ---- - -`ASViewController` is a subclass of `UIViewController` that adds several useful features for hosting `ASDisplayNode` hierarchies. - -An `ASViewController` can be used in place of any `UIViewController` - including within a `UINavigationController`, `UITabBarController` and `UISplitViewController` or as a modal view controller. - -Benefits of using an `ASViewController`: -
    -
  1. Save Memory. An ASViewController that goes off screen will automatically reduce the size of the fetch data and display ranges of any of its children. This is key for memory management in large applications.
  2. -
  3. ASVisibility Feature. When used in an ASNavigationController or ASTabBarController, these classes know the exact number of user taps it would take to make the view controller visible.
  4. -
- -More features will be added over time, so it is a good idea to base your view controllers off of this class. - -## Usage - -A `UIViewController` provides a view of its own. An `ASViewController` is assigned a node to manage in its designated initializer `-initWithNode:`. - -Consider the following `ASViewController` subclass, `PhotoFeedNodeController`, from the ASDKgram example project that would like to use a table node as its managed node. - -This table node is assigned to the `ASViewController` in its `-initWithNode:` designated initializer method. - -
-SwiftObjective-C -
-
-- (instancetype)init
-{
-  _tableNode = [[ASTableNode alloc] initWithStyle:UITableViewStylePlain];
-  self = [super initWithNode:_tableNode];
-  
-  if (self) {
-    _tableNode.dataSource = self;
-    _tableNode.delegate = self;
-  }
-  
-  return self;
-}
-  
- - -
-
- -
-
-Conversion Tip: If your app already has a complex view controller hierarchy, it is perfectly fine to have all of them subclass ASViewController. That is to say, even if you don't use ASViewController's designated initializer -initWithNode:, and only use the ASViewController in the manner of a traditional UIViewController, this will give you the additional node support if you choose to adopt it in different areas your application. -
- diff --git a/docs/_docs/containers-overview.md b/docs/_docs/containers-overview.md index cde2fb7f8..dc5a4dfb7 100755 --- a/docs/_docs/containers-overview.md +++ b/docs/_docs/containers-overview.md @@ -27,11 +27,11 @@ It is highly recommended that you use Texture's nodes within a node container. T in place of UIKit's UITableView - ASViewController + ASDKViewController in place of UIKit's UIViewController - ASNavigationController + ASDKNavigationController in place of UIKit's UINavigationController. Implements the ASVisibility protocol. diff --git a/docs/_docs/development/overview.md b/docs/_docs/development/overview.md index 4c659c05c..0dc7439ab 100644 --- a/docs/_docs/development/overview.md +++ b/docs/_docs/development/overview.md @@ -25,7 +25,7 @@ Here are the main directories within the repository: - [Private](https://github.com/TextureGroup/Texture/tree/master/Source/Private): Framework-private files that are not exposed to end users, including implementation details, private data structures and helpers. - [TextKit](https://github.com/TextureGroup/Texture/tree/master/Source/TextKit): All files related to TextKit that are used by ASTextNode. - [tvOS](https://github.com/TextureGroup/Texture/tree/master/Source/tvOS): tvOS support. - - All other files in the [Source](https://github.com/TextureGroup/Texture/tree/master/Source) directory: Main files, including important components such as nodes (e.g ASDisplayNode, ASButtonNode, ASImageNode, ASCollectionNode and ASTableNode), ASNavigationController, etc. + - All other files in the [Source](https://github.com/TextureGroup/Texture/tree/master/Source) directory: Main files, including important components such as nodes (e.g ASDisplayNode, ASButtonNode, ASImageNode, ASCollectionNode and ASTableNode), ASDKNavigationController, etc. - [Tests](https://github.com/TextureGroup/Texture/tree/master/Tests): The framework's test suite, including unit, integration and snapshot test cases. - [docs](https://github.com/TextureGroup/Texture/tree/master/docs): Texture documentation that powers [texturegroup.org](https://texturegroup.org/). - [examples](https://github.com/TextureGroup/Texture/tree/master/examples): Sample projects which demonstrate how to use various features of the framework. diff --git a/docs/_docs/layout-options.md b/docs/_docs/layout-options.md index 709a7f8be..46b368923 100755 --- a/docs/_docs/layout-options.md +++ b/docs/_docs/layout-options.md @@ -9,7 +9,7 @@ nextPage: layer-backing.html When using Texture, you have three options for layout. Note that UIKit Autolayout is **not** supported by Texture. #Manual Sizing & Layout -This original layout method shipped with Texture 1.0 and is analogous to UIKit's layout methods. Use this method for ASViewControllers (unless you subclass the node). +This original layout method shipped with Texture 1.0 and is analogous to UIKit's layout methods. Use this method for ASDKViewControllers (unless you subclass the node). `[ASDisplayNode calculateSizeThatFits:]` **vs.** `[UIView sizeThatFits:]` diff --git a/docs/appledoc/Categories/ASViewController+ASRangeControllerUpdateRangeProtocol.html b/docs/appledoc/Categories/ASDKViewController+ASRangeControllerUpdateRangeProtocol.html similarity index 92% rename from docs/appledoc/Categories/ASViewController+ASRangeControllerUpdateRangeProtocol.html rename to docs/appledoc/Categories/ASDKViewController+ASRangeControllerUpdateRangeProtocol.html index 0c0d6ab95..7c055d815 100755 --- a/docs/appledoc/Categories/ASViewController+ASRangeControllerUpdateRangeProtocol.html +++ b/docs/appledoc/Categories/ASDKViewController+ASRangeControllerUpdateRangeProtocol.html @@ -3,7 +3,7 @@ - ASViewController(ASRangeControllerUpdateRangeProtocol) Category Reference + ASDKViewController(ASRangeControllerUpdateRangeProtocol) Category Reference @@ -75,13 +75,13 @@

-

ASViewController(ASRangeControllerUpdateRangeProtocol) Category Reference

+

ASDKViewController(ASRangeControllerUpdateRangeProtocol) Category Reference

- +
Declared inASViewController.hASDKViewController.h
@@ -139,7 +139,7 @@

Discussion

Declared In

-

ASViewController.h

+

ASDKViewController.h

diff --git a/docs/appledoc/Classes/ASNavigationController.html b/docs/appledoc/Classes/ASDKNavigationController.html similarity index 86% rename from docs/appledoc/Classes/ASNavigationController.html rename to docs/appledoc/Classes/ASDKNavigationController.html index 4dd2da497..650a2ae50 100755 --- a/docs/appledoc/Classes/ASNavigationController.html +++ b/docs/appledoc/Classes/ASDKNavigationController.html @@ -3,7 +3,7 @@ - ASNavigationController Class Reference + ASDKNavigationController Class Reference @@ -69,7 +69,7 @@

-

ASNavigationController Class Reference

+

ASDKNavigationController Class Reference

@@ -81,7 +81,7 @@

ASNavigationController Class Reference

- +
ASManagesChildVisibilityDepth
Declared inASNavigationController.hASDKNavigationController.h
@@ -91,9 +91,9 @@

ASNavigationController Class Reference

Overview

-

ASNavigationController

ASNavigationController is a drop in replacement for UINavigationController +

ASDKNavigationController

ASDKNavigationController is a drop in replacement for UINavigationController which improves memory efficiency by implementing the @c ASManagesChildVisibilityDepth protocol. -You can use ASNavigationController with regular UIViewControllers, as well as ASViewControllers. +You can use ASDKNavigationController with regular UIViewControllers, as well as ASDKViewControllers. It is safe to subclass or use even where AsyncDisplayKit is not adopted.

diff --git a/docs/appledoc/Classes/ASViewController.html b/docs/appledoc/Classes/ASDKViewController.html similarity index 92% rename from docs/appledoc/Classes/ASViewController.html rename to docs/appledoc/Classes/ASDKViewController.html index d29e08e03..4b05809e0 100755 --- a/docs/appledoc/Classes/ASViewController.html +++ b/docs/appledoc/Classes/ASDKViewController.html @@ -3,7 +3,7 @@ - ASViewController Class Reference + ASDKViewController Class Reference @@ -89,7 +89,7 @@

@@ -365,7 +365,7 @@

See Also

Declared In

-

ASViewController.h

+

ASDKViewController.h

@@ -413,7 +413,7 @@

Discussion

Declared In

-

ASViewController.h

+

ASDKViewController.h

diff --git a/docs/appledoc/Constants/ASInterfaceState.html b/docs/appledoc/Constants/ASInterfaceState.html index ab0706f83..4182ee0a9 100755 --- a/docs/appledoc/Constants/ASInterfaceState.html +++ b/docs/appledoc/Constants/ASInterfaceState.html @@ -79,7 +79,7 @@

ASInterfaceState

-

Interface state is available on ASDisplayNode and ASViewController, and +

Interface state is available on ASDisplayNode and ASDKViewController, and allows checking whether a node is in an interface situation where it is prudent to trigger certain actions: measurement, data loading, display, and visibility (the latter for animations or other onscreen-only effects).

diff --git a/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html b/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html index 817097a2b..8748e6cd5 100755 --- a/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html +++ b/docs/appledoc/Protocols/ASManagesChildVisibilityDepth.html @@ -125,7 +125,7 @@

Container view controllers should adopt this protocol to indicate that they will manage their child’s -visibilityDepth. For example, ASNavigationController adopts this protocol and manages its childrens visibility +visibilityDepth. For example, ASDKNavigationController adopts this protocol and manages its childrens visibility depth.

If you adopt this protocol, you must also emit visibilityDepthDidChange messages to child view controllers.

diff --git a/docs/appledoc/Protocols/ASVisibilityDepth.html b/docs/appledoc/Protocols/ASVisibilityDepth.html index 29597c887..4e6267ff8 100755 --- a/docs/appledoc/Protocols/ASVisibilityDepth.html +++ b/docs/appledoc/Protocols/ASVisibilityDepth.html @@ -99,7 +99,7 @@

ASVisibilityDepth Protocol Reference

Overview

ASVisibilityDepth

“Visibility Depth” represents the number of user actions required to make an ASDisplayNode or -ASViewController visibile. Texture uses this information to intelligently manage memory and focus +ASDKViewController visibile. Texture uses this information to intelligently manage memory and focus resources where they are most visible to the user.

The ASVisibilityDepth protocol describes how custom view controllers can integrate with this system.

@@ -205,13 +205,13 @@

Discussion

has changed.

If implemented by a view controller container, use this method to notify child view controllers that their view -depth has changed @see ASNavigationController.m

+depth has changed @see ASDKNavigationController.m

-

If implemented on an ASViewController, use this method to reduce or increase the resources that your +

If implemented on an ASDKViewController, use this method to reduce or increase the resources that your view controller uses. A higher visibility depth view controller should decrease it’s resource usage, a lower visibility depth controller should pre-warm resources in preperation for a display at 0 depth.

-

ASViewController implements this method and reduces / increases range mode of supporting nodes (such as ASCollectionNode +

ASDKViewController implements this method and reduces / increases range mode of supporting nodes (such as ASCollectionNode and ASTableNode).

diff --git a/docs/appledoc/hierarchy.html b/docs/appledoc/hierarchy.html index f9eb61138..3830fe769 100755 --- a/docs/appledoc/hierarchy.html +++ b/docs/appledoc/hierarchy.html @@ -112,7 +112,7 @@

Class Hierarchy

-
  • ASViewController
  • +
  • ASDKViewController
  • NSObject
      @@ -165,7 +165,7 @@

      Class Hierarchy

    • UINavigationController
    • @@ -365,7 +365,7 @@

      Category References

    • ASTextNode(Deprecated)
    • -
    • ASViewController(ASRangeControllerUpdateRangeProtocol)
    • +
    • ASDKViewController(ASRangeControllerUpdateRangeProtocol)
    • CALayer(AsyncDisplayKit)
    • diff --git a/docs/appledoc/index.html b/docs/appledoc/index.html index 27076d4fb..7c2896717 100755 --- a/docs/appledoc/index.html +++ b/docs/appledoc/index.html @@ -86,7 +86,7 @@

      Class References

    • ASMultiplexImageNode
    • -
    • ASNavigationController
    • +
    • ASDKNavigationController
    • ASNetworkImageNode
    • @@ -118,7 +118,7 @@

      Class References

    • ASVideoPlayerNode
    • -
    • ASViewController
    • +
    • ASDKViewController
    • ASWrapperLayoutSpec
    • @@ -302,7 +302,7 @@

      Category References

    • ASTextNode(Deprecated)
    • -
    • ASViewController(ASRangeControllerUpdateRangeProtocol)
    • +
    • ASDKViewController(ASRangeControllerUpdateRangeProtocol)
    • CALayer(AsyncDisplayKit)
    • diff --git a/examples/ASCollectionView/Podfile b/examples/ASCollectionView/Podfile index 08d1b7add..108b3ae44 100644 --- a/examples/ASCollectionView/Podfile +++ b/examples/ASCollectionView/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/ASDKLayoutTransition/Podfile b/examples/ASDKLayoutTransition/Podfile index 0fbf4c952..cbdb4fd56 100644 --- a/examples/ASDKLayoutTransition/Podfile +++ b/examples/ASDKLayoutTransition/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/ASDKTube/Podfile b/examples/ASDKTube/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/ASDKTube/Podfile +++ b/examples/ASDKTube/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/ASDKgram/Podfile b/examples/ASDKgram/Podfile index 69504e8ef..26b3a6411 100644 --- a/examples/ASDKgram/Podfile +++ b/examples/ASDKgram/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture/IGListKit', :path => '../..' diff --git a/examples/ASMapNode/Podfile b/examples/ASMapNode/Podfile index 08d1b7add..108b3ae44 100644 --- a/examples/ASMapNode/Podfile +++ b/examples/ASMapNode/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/ASViewController/Podfile b/examples/ASViewController/Podfile index 08d1b7add..108b3ae44 100644 --- a/examples/ASViewController/Podfile +++ b/examples/ASViewController/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/AnimatedGIF/Podfile b/examples/AnimatedGIF/Podfile index c998fa0a8..e653ed7b5 100644 --- a/examples/AnimatedGIF/Podfile +++ b/examples/AnimatedGIF/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/AsyncDisplayKitOverview/Podfile b/examples/AsyncDisplayKitOverview/Podfile index ff6cb63a3..ed581f79e 100644 --- a/examples/AsyncDisplayKitOverview/Podfile +++ b/examples/AsyncDisplayKitOverview/Podfile @@ -1,3 +1,4 @@ +source 'https://cdn.cocoapods.org/' # Uncomment this line to define a global platform for your project platform :ios, '9.0' diff --git a/examples/CatDealsCollectionView/Podfile b/examples/CatDealsCollectionView/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/CatDealsCollectionView/Podfile +++ b/examples/CatDealsCollectionView/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/CustomCollectionView-Swift/Podfile b/examples/CustomCollectionView-Swift/Podfile index 92a9acc9c..6ae53e286 100644 --- a/examples/CustomCollectionView-Swift/Podfile +++ b/examples/CustomCollectionView-Swift/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' use_frameworks! diff --git a/examples/CustomCollectionView/Podfile b/examples/CustomCollectionView/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/CustomCollectionView/Podfile +++ b/examples/CustomCollectionView/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/HorizontalWithinVerticalScrolling/Podfile b/examples/HorizontalWithinVerticalScrolling/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/HorizontalWithinVerticalScrolling/Podfile +++ b/examples/HorizontalWithinVerticalScrolling/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/Kittens/Podfile b/examples/Kittens/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/Kittens/Podfile +++ b/examples/Kittens/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/LayoutSpecExamples-Swift/Podfile b/examples/LayoutSpecExamples-Swift/Podfile index 83d2cae8b..8f0a2963a 100644 --- a/examples/LayoutSpecExamples-Swift/Podfile +++ b/examples/LayoutSpecExamples-Swift/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' use_frameworks! diff --git a/examples/LayoutSpecExamples/Podfile b/examples/LayoutSpecExamples/Podfile index 08d1b7add..108b3ae44 100644 --- a/examples/LayoutSpecExamples/Podfile +++ b/examples/LayoutSpecExamples/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/PagerNode/Podfile b/examples/PagerNode/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/PagerNode/Podfile +++ b/examples/PagerNode/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/SocialAppLayout-Inverted/Podfile b/examples/SocialAppLayout-Inverted/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/SocialAppLayout-Inverted/Podfile +++ b/examples/SocialAppLayout-Inverted/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/SocialAppLayout/Podfile b/examples/SocialAppLayout/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/SocialAppLayout/Podfile +++ b/examples/SocialAppLayout/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/Swift/Podfile b/examples/Swift/Podfile index 83d2cae8b..8f0a2963a 100644 --- a/examples/Swift/Podfile +++ b/examples/Swift/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' use_frameworks! diff --git a/examples/VerticalWithinHorizontalScrolling/Podfile b/examples/VerticalWithinHorizontalScrolling/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/VerticalWithinHorizontalScrolling/Podfile +++ b/examples/VerticalWithinHorizontalScrolling/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples/Videos/Podfile b/examples/Videos/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples/Videos/Podfile +++ b/examples/Videos/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/ASDKgram-Swift/Podfile b/examples_extra/ASDKgram-Swift/Podfile index 5510b59d9..26a1bbbf9 100644 --- a/examples_extra/ASDKgram-Swift/Podfile +++ b/examples_extra/ASDKgram-Swift/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'ASDKgram-Swift' do use_frameworks! diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Podfile b/examples_extra/ASLayoutSpecPlayground-Swift/Podfile index 3b379097a..3d1f3062c 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Podfile +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' use_frameworks! target 'Sample' do diff --git a/examples_extra/ASTableViewStressTest/Podfile b/examples_extra/ASTableViewStressTest/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/ASTableViewStressTest/Podfile +++ b/examples_extra/ASTableViewStressTest/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/ASTraitCollection/Podfile b/examples_extra/ASTraitCollection/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/ASTraitCollection/Podfile +++ b/examples_extra/ASTraitCollection/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/BackgroundPropertySetting/Podfile b/examples_extra/BackgroundPropertySetting/Podfile index 3b379097a..3d1f3062c 100644 --- a/examples_extra/BackgroundPropertySetting/Podfile +++ b/examples_extra/BackgroundPropertySetting/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' use_frameworks! target 'Sample' do diff --git a/examples_extra/CollectionViewWithViewControllerCells/Podfile b/examples_extra/CollectionViewWithViewControllerCells/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Podfile +++ b/examples_extra/CollectionViewWithViewControllerCells/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/EditableText/Podfile b/examples_extra/EditableText/Podfile index 08d1b7add..108b3ae44 100644 --- a/examples_extra/EditableText/Podfile +++ b/examples_extra/EditableText/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/Multiplex/Podfile b/examples_extra/Multiplex/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/Multiplex/Podfile +++ b/examples_extra/Multiplex/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/Placeholders/Podfile b/examples_extra/Placeholders/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/Placeholders/Podfile +++ b/examples_extra/Placeholders/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/RepoSearcher/Podfile b/examples_extra/RepoSearcher/Podfile index 21dc49860..2521a46ba 100644 --- a/examples_extra/RepoSearcher/Podfile +++ b/examples_extra/RepoSearcher/Podfile @@ -1,3 +1,4 @@ +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'RepoSearcher' do diff --git a/examples_extra/Shop/Podfile b/examples_extra/Shop/Podfile index b12d45be7..82caaa39e 100644 --- a/examples_extra/Shop/Podfile +++ b/examples_extra/Shop/Podfile @@ -1,6 +1,7 @@ # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' +source 'https://cdn.cocoapods.org/' target 'Shop' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks # use_frameworks! diff --git a/examples_extra/SynchronousConcurrency/Podfile b/examples_extra/SynchronousConcurrency/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/SynchronousConcurrency/Podfile +++ b/examples_extra/SynchronousConcurrency/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/SynchronousKittens/Podfile b/examples_extra/SynchronousKittens/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/SynchronousKittens/Podfile +++ b/examples_extra/SynchronousKittens/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..' diff --git a/examples_extra/TextStressTest/Podfile b/examples_extra/TextStressTest/Podfile index 73e26195c..fd3896a39 100644 --- a/examples_extra/TextStressTest/Podfile +++ b/examples_extra/TextStressTest/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture/Yoga', :path => '../..' diff --git a/examples_extra/VideoTableView/Podfile b/examples_extra/VideoTableView/Podfile index 71a7f2c4b..2c3865603 100644 --- a/examples_extra/VideoTableView/Podfile +++ b/examples_extra/VideoTableView/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' platform :ios, '9.0' target 'Sample' do pod 'Texture', :path => '../..'