From 28207c678d68467f95cc8d8427ef3c3d2da23544 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Mon, 8 Feb 2016 12:57:05 -0800 Subject: [PATCH] Remove ASRangeHandler protocol with all classes that implement it With the move to the new ASRangeController we don't need the ASRangeHandler protocol anymore --- AsyncDisplayKit.xcodeproj/project.pbxproj | 42 ----------- AsyncDisplayKit/AsyncDisplayKit.h | 3 - AsyncDisplayKit/Details/ASRangeController.mm | 3 - AsyncDisplayKit/Details/ASRangeHandler.h | 26 ------- .../Details/ASRangeHandlerPreload.h | 19 ----- .../Details/ASRangeHandlerPreload.mm | 27 ------- .../Details/ASRangeHandlerRender.h | 19 ----- .../Details/ASRangeHandlerRender.mm | 74 ------------------- .../Details/ASRangeHandlerVisible.h | 15 ---- .../Details/ASRangeHandlerVisible.mm | 25 ------- 10 files changed, 253 deletions(-) delete mode 100644 AsyncDisplayKit/Details/ASRangeHandler.h delete mode 100644 AsyncDisplayKit/Details/ASRangeHandlerPreload.h delete mode 100644 AsyncDisplayKit/Details/ASRangeHandlerPreload.mm delete mode 100644 AsyncDisplayKit/Details/ASRangeHandlerRender.h delete mode 100644 AsyncDisplayKit/Details/ASRangeHandlerRender.mm delete mode 100644 AsyncDisplayKit/Details/ASRangeHandlerVisible.h delete mode 100644 AsyncDisplayKit/Details/ASRangeHandlerVisible.mm diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 9695be1a49..859858ca93 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -186,10 +186,6 @@ 257754C21BEE458E00737CA5 /* ASTextKitCoreTextAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 257754BB1BEE458E00737CA5 /* ASTextKitCoreTextAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 257754C31BEE458E00737CA5 /* ASTextNodeTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 257754BC1BEE458E00737CA5 /* ASTextNodeTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 257754C41BEE458E00737CA5 /* ASTextNodeWordKerner.m in Sources */ = {isa = PBXBuildFile; fileRef = 257754BD1BEE458E00737CA5 /* ASTextNodeWordKerner.m */; }; - 258FF4271C0D152600A83844 /* ASRangeHandlerVisible.h in Headers */ = {isa = PBXBuildFile; fileRef = 258FF4251C0D152600A83844 /* ASRangeHandlerVisible.h */; }; - 258FF4281C0D152600A83844 /* ASRangeHandlerVisible.mm in Sources */ = {isa = PBXBuildFile; fileRef = 258FF4261C0D152600A83844 /* ASRangeHandlerVisible.mm */; }; - 25A977EF1C0D2A5500406B62 /* ASRangeHandlerVisible.mm in Sources */ = {isa = PBXBuildFile; fileRef = 258FF4261C0D152600A83844 /* ASRangeHandlerVisible.mm */; }; - 25BAA16F1C0D18D2002747C7 /* ASRangeHandlerVisible.h in Headers */ = {isa = PBXBuildFile; fileRef = 258FF4251C0D152600A83844 /* ASRangeHandlerVisible.h */; }; 25E327561C16819500A2170C /* ASPagerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 25E327541C16819500A2170C /* ASPagerNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25E327571C16819500A2170C /* ASPagerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 25E327541C16819500A2170C /* ASPagerNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25E327581C16819500A2170C /* ASPagerNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 25E327551C16819500A2170C /* ASPagerNode.m */; }; @@ -199,11 +195,6 @@ 2911485C1A77147A005D0878 /* ASControlNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2911485B1A77147A005D0878 /* ASControlNodeTests.m */; }; 291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 296A0A311A951715005ACEAA /* ASScrollDirection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 292C599F1A956527007E5DD6 /* ASLayoutRangeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C59991A956527007E5DD6 /* ASLayoutRangeType.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 292C59A01A956527007E5DD6 /* ASRangeHandlerPreload.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C599A1A956527007E5DD6 /* ASRangeHandlerPreload.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 292C59A11A956527007E5DD6 /* ASRangeHandlerPreload.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292C599B1A956527007E5DD6 /* ASRangeHandlerPreload.mm */; }; - 292C59A21A956527007E5DD6 /* ASRangeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C599C1A956527007E5DD6 /* ASRangeHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 292C59A31A956527007E5DD6 /* ASRangeHandlerRender.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C599D1A956527007E5DD6 /* ASRangeHandlerRender.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 292C59A41A956527007E5DD6 /* ASRangeHandlerRender.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292C599E1A956527007E5DD6 /* ASRangeHandlerRender.mm */; }; 2967F9E21AB0A5190072E4AB /* ASBasicImageDownloaderInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2967F9E11AB0A4CF0072E4AB /* ASBasicImageDownloaderInternal.h */; }; 296A0A351A951ABF005ACEAA /* ASBatchFetchingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 296A0A341A951ABF005ACEAA /* ASBatchFetchingTests.m */; }; 299DA1A91A828D2900162D41 /* ASBatchContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 299DA1A71A828D2900162D41 /* ASBatchContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -424,11 +415,6 @@ B35062251B010EFD0018CF92 /* ASMutableAttributedStringBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 058D09E9195D050800B7D73C /* ASMutableAttributedStringBuilder.m */; }; B35062261B010EFD0018CF92 /* ASRangeController.h in Headers */ = {isa = PBXBuildFile; fileRef = 055F1A3619ABD413004DAFF1 /* ASRangeController.h */; settings = {ATTRIBUTES = (Public, ); }; }; B35062271B010EFD0018CF92 /* ASRangeController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055F1A3719ABD413004DAFF1 /* ASRangeController.mm */; }; - B35062281B010EFD0018CF92 /* ASRangeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C599C1A956527007E5DD6 /* ASRangeHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B35062291B010EFD0018CF92 /* ASRangeHandlerPreload.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C599A1A956527007E5DD6 /* ASRangeHandlerPreload.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B350622A1B010EFD0018CF92 /* ASRangeHandlerPreload.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292C599B1A956527007E5DD6 /* ASRangeHandlerPreload.mm */; }; - B350622B1B010EFD0018CF92 /* ASRangeHandlerRender.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C599D1A956527007E5DD6 /* ASRangeHandlerRender.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B350622C1B010EFD0018CF92 /* ASRangeHandlerRender.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292C599E1A956527007E5DD6 /* ASRangeHandlerRender.mm */; }; B350622D1B010EFD0018CF92 /* ASScrollDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 296A0A311A951715005ACEAA /* ASScrollDirection.h */; settings = {ATTRIBUTES = (Public, ); }; }; B35062391B010EFD0018CF92 /* ASThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 058D0A12195D050800B7D73C /* ASThread.h */; settings = {ATTRIBUTES = (Public, ); }; }; B350623A1B010EFD0018CF92 /* NSMutableAttributedString+TextKitAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 058D09F5195D050800B7D73C /* NSMutableAttributedString+TextKitAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -684,17 +670,10 @@ 257754BB1BEE458E00737CA5 /* ASTextKitCoreTextAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTextKitCoreTextAdditions.h; path = TextKit/ASTextKitCoreTextAdditions.h; sourceTree = ""; }; 257754BC1BEE458E00737CA5 /* ASTextNodeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTextNodeTypes.h; path = TextKit/ASTextNodeTypes.h; sourceTree = ""; }; 257754BD1BEE458E00737CA5 /* ASTextNodeWordKerner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASTextNodeWordKerner.m; path = TextKit/ASTextNodeWordKerner.m; sourceTree = ""; }; - 258FF4251C0D152600A83844 /* ASRangeHandlerVisible.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRangeHandlerVisible.h; sourceTree = ""; }; - 258FF4261C0D152600A83844 /* ASRangeHandlerVisible.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRangeHandlerVisible.mm; sourceTree = ""; }; 25E327541C16819500A2170C /* ASPagerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ASPagerNode.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 25E327551C16819500A2170C /* ASPagerNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASPagerNode.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 2911485B1A77147A005D0878 /* ASControlNodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASControlNodeTests.m; sourceTree = ""; }; 292C59991A956527007E5DD6 /* ASLayoutRangeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutRangeType.h; sourceTree = ""; }; - 292C599A1A956527007E5DD6 /* ASRangeHandlerPreload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRangeHandlerPreload.h; sourceTree = ""; }; - 292C599B1A956527007E5DD6 /* ASRangeHandlerPreload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRangeHandlerPreload.mm; sourceTree = ""; }; - 292C599C1A956527007E5DD6 /* ASRangeHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRangeHandler.h; sourceTree = ""; }; - 292C599D1A956527007E5DD6 /* ASRangeHandlerRender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRangeHandlerRender.h; sourceTree = ""; }; - 292C599E1A956527007E5DD6 /* ASRangeHandlerRender.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRangeHandlerRender.mm; sourceTree = ""; }; 2967F9E11AB0A4CF0072E4AB /* ASBasicImageDownloaderInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASBasicImageDownloaderInternal.h; sourceTree = ""; }; 296A0A311A951715005ACEAA /* ASScrollDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASScrollDirection.h; path = AsyncDisplayKit/Details/ASScrollDirection.h; sourceTree = SOURCE_ROOT; }; 296A0A341A951ABF005ACEAA /* ASBatchFetchingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASBatchFetchingTests.m; sourceTree = ""; }; @@ -1091,13 +1070,6 @@ 058D09E9195D050800B7D73C /* ASMutableAttributedStringBuilder.m */, 055F1A3619ABD413004DAFF1 /* ASRangeController.h */, 055F1A3719ABD413004DAFF1 /* ASRangeController.mm */, - 292C599C1A956527007E5DD6 /* ASRangeHandler.h */, - 258FF4251C0D152600A83844 /* ASRangeHandlerVisible.h */, - 258FF4261C0D152600A83844 /* ASRangeHandlerVisible.mm */, - 292C599A1A956527007E5DD6 /* ASRangeHandlerPreload.h */, - 292C599B1A956527007E5DD6 /* ASRangeHandlerPreload.mm */, - 292C599D1A956527007E5DD6 /* ASRangeHandlerRender.h */, - 292C599E1A956527007E5DD6 /* ASRangeHandlerRender.mm */, 296A0A311A951715005ACEAA /* ASScrollDirection.h */, 205F0E111B371BD7007741D0 /* ASScrollDirection.m */, 058D0A12195D050800B7D73C /* ASThread.h */, @@ -1360,7 +1332,6 @@ DECBD6E71BE56E1900CF4905 /* ASButtonNode.h in Headers */, DBC452DB1C5BF64600B16017 /* NSArray+Diffing.h in Headers */, 058D0A4C195D05CB00B7D73C /* ASDisplayNode+Subclasses.h in Headers */, - 258FF4271C0D152600A83844 /* ASRangeHandlerVisible.h in Headers */, 058D0A4A195D05CB00B7D73C /* ASDisplayNode.h in Headers */, 058D0A84195D060300B7D73C /* ASDisplayNodeExtraIvars.h in Headers */, AC7A2C171BDE11DF0093FE1A /* ASTableViewInternal.h in Headers */, @@ -1403,9 +1374,6 @@ 055B9FA81A1C154B00035D6D /* ASNetworkImageNode.h in Headers */, ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutSpec.h in Headers */, 055F1A3819ABD413004DAFF1 /* ASRangeController.h in Headers */, - 292C59A21A956527007E5DD6 /* ASRangeHandler.h in Headers */, - 292C59A01A956527007E5DD6 /* ASRangeHandlerPreload.h in Headers */, - 292C59A31A956527007E5DD6 /* ASRangeHandlerRender.h in Headers */, ACF6ED2D1B17843500DA7C62 /* ASRatioLayoutSpec.h in Headers */, AC47D9451B3BB41900AAEE9D /* ASRelativeSize.h in Headers */, 291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */, @@ -1447,7 +1415,6 @@ buildActionMask = 2147483647; files = ( AC026B6A1BD57D6F00BBC17E /* ASChangeSetDataController.h in Headers */, - 25BAA16F1C0D18D2002747C7 /* ASRangeHandlerVisible.h in Headers */, B35062481B010EFD0018CF92 /* _AS-objc-internal.h in Headers */, B350623C1B010EFD0018CF92 /* _ASAsyncTransaction.h in Headers */, B350623E1B010EFD0018CF92 /* _ASAsyncTransactionContainer+Private.h in Headers */, @@ -1531,9 +1498,6 @@ B35062061B010EFD0018CF92 /* ASNetworkImageNode.h in Headers */, 34EFC76C1B701CED00AD841F /* ASOverlayLayoutSpec.h in Headers */, B35062261B010EFD0018CF92 /* ASRangeController.h in Headers */, - B35062281B010EFD0018CF92 /* ASRangeHandler.h in Headers */, - B35062291B010EFD0018CF92 /* ASRangeHandlerPreload.h in Headers */, - B350622B1B010EFD0018CF92 /* ASRangeHandlerRender.h in Headers */, 34EFC76E1B701CF400AD841F /* ASRatioLayoutSpec.h in Headers */, 34EFC7651B701CCC00AD841F /* ASRelativeSize.h in Headers */, 254C6B741BF94DF4003EC431 /* ASTextNodeWordKerner.h in Headers */, @@ -1828,8 +1792,6 @@ 257754AB1BEE44CD00737CA5 /* ASTextKitEntityAttribute.m in Sources */, 055F1A3919ABD413004DAFF1 /* ASRangeController.mm in Sources */, 044285091BAA63FE00D16268 /* ASBatchFetching.m in Sources */, - 292C59A11A956527007E5DD6 /* ASRangeHandlerPreload.mm in Sources */, - 292C59A41A956527007E5DD6 /* ASRangeHandlerRender.mm in Sources */, 257754AE1BEE44CD00737CA5 /* ASTextKitRenderer+Positioning.mm in Sources */, ACF6ED2E1B17843500DA7C62 /* ASRatioLayoutSpec.mm in Sources */, AC47D9461B3BB41900AAEE9D /* ASRelativeSize.mm in Sources */, @@ -1837,7 +1799,6 @@ D785F6631A74327E00291744 /* ASScrollNode.m in Sources */, 058D0A2C195D050800B7D73C /* ASSentinel.m in Sources */, 9C8221971BA237B80037F19A /* ASStackBaselinePositionedLayout.mm in Sources */, - 258FF4281C0D152600A83844 /* ASRangeHandlerVisible.mm in Sources */, 251B8EF81BBB3D690087C538 /* ASCollectionDataController.mm in Sources */, ACF6ED301B17843500DA7C62 /* ASStackLayoutSpec.mm in Sources */, 257754BE1BEE458E00737CA5 /* ASTextKitHelpers.mm in Sources */, @@ -1966,14 +1927,11 @@ 044285101BAA64EC00D16268 /* ASMultidimensionalArrayUtils.mm in Sources */, B35062271B010EFD0018CF92 /* ASRangeController.mm in Sources */, 0442850A1BAA63FE00D16268 /* ASBatchFetching.m in Sources */, - B350622A1B010EFD0018CF92 /* ASRangeHandlerPreload.mm in Sources */, - B350622C1B010EFD0018CF92 /* ASRangeHandlerRender.mm in Sources */, 34EFC76F1B701CF700AD841F /* ASRatioLayoutSpec.mm in Sources */, 254C6B8B1BF94F8A003EC431 /* ASTextKitShadower.mm in Sources */, 34EFC7661B701CD200AD841F /* ASRelativeSize.mm in Sources */, 254C6B851BF94F8A003EC431 /* ASTextKitAttributes.mm in Sources */, 509E68601B3AED8E009B9150 /* ASScrollDirection.m in Sources */, - 25A977EF1C0D2A5500406B62 /* ASRangeHandlerVisible.mm in Sources */, B35062091B010EFD0018CF92 /* ASScrollNode.m in Sources */, B35062561B010EFD0018CF92 /* ASSentinel.m in Sources */, 9C8221981BA237B80037F19A /* ASStackBaselinePositionedLayout.mm in Sources */, diff --git a/AsyncDisplayKit/AsyncDisplayKit.h b/AsyncDisplayKit/AsyncDisplayKit.h index b854d7564a..2ad55f9080 100644 --- a/AsyncDisplayKit/AsyncDisplayKit.h +++ b/AsyncDisplayKit/AsyncDisplayKit.h @@ -63,9 +63,6 @@ #import #import #import -#import -#import -#import #import #import #import diff --git a/AsyncDisplayKit/Details/ASRangeController.mm b/AsyncDisplayKit/Details/ASRangeController.mm index 3b6966d9c6..1b8d7d8f89 100644 --- a/AsyncDisplayKit/Details/ASRangeController.mm +++ b/AsyncDisplayKit/Details/ASRangeController.mm @@ -12,9 +12,6 @@ #import "ASDisplayNodeExtras.h" #import "ASDisplayNodeInternal.h" #import "ASMultiDimensionalArrayUtils.h" -#import "ASRangeHandlerVisible.h" -#import "ASRangeHandlerRender.h" -#import "ASRangeHandlerPreload.h" #import "ASInternalHelpers.h" #import "ASDisplayNode+FrameworkPrivate.h" diff --git a/AsyncDisplayKit/Details/ASRangeHandler.h b/AsyncDisplayKit/Details/ASRangeHandler.h deleted file mode 100644 index 136736f442..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandler.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -NS_ASSUME_NONNULL_BEGIN - -@class ASDisplayNode; - -@protocol ASRangeHandler - -@required - -- (void)node:(ASDisplayNode *)node enteredRangeOfType:(ASLayoutRangeType)rangeType; -- (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType; - -@end - -NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/AsyncDisplayKit/Details/ASRangeHandlerPreload.h b/AsyncDisplayKit/Details/ASRangeHandlerPreload.h deleted file mode 100644 index eb7c34f991..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandlerPreload.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface ASRangeHandlerPreload : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASRangeHandlerPreload.mm b/AsyncDisplayKit/Details/ASRangeHandlerPreload.mm deleted file mode 100644 index 3eccec5dd8..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandlerPreload.mm +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ASRangeHandlerPreload.h" -#import "ASDisplayNode.h" -#import "ASDisplayNode+FrameworkPrivate.h" - -@implementation ASRangeHandlerPreload - -- (void)node:(ASDisplayNode *)node enteredRangeOfType:(ASLayoutRangeType)rangeType -{ - ASDisplayNodeAssert(rangeType == ASLayoutRangeTypeFetchData, @"Preload delegate should not handle other ranges"); - [node enterInterfaceState:ASInterfaceStateFetchData]; -} - -- (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType -{ - ASDisplayNodeAssert(rangeType == ASLayoutRangeTypeFetchData, @"Preload delegate should not handle other ranges"); - [node exitInterfaceState:ASInterfaceStateFetchData]; -} - -@end diff --git a/AsyncDisplayKit/Details/ASRangeHandlerRender.h b/AsyncDisplayKit/Details/ASRangeHandlerRender.h deleted file mode 100644 index 8b00982b99..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandlerRender.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface ASRangeHandlerRender : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASRangeHandlerRender.mm b/AsyncDisplayKit/Details/ASRangeHandlerRender.mm deleted file mode 100644 index df7b4acb93..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandlerRender.mm +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ASRangeHandlerRender.h" - -#import "ASDisplayNode.h" -#import "ASDisplayNode+Subclasses.h" -#import "ASDisplayNode+FrameworkPrivate.h" -#import "ASDisplayNode+Beta.h" - -@interface ASRangeHandlerRender () -@property (nonatomic,readonly) UIWindow *workingWindow; -@end - -@implementation ASRangeHandlerRender - -- (void)node:(ASDisplayNode *)node enteredRangeOfType:(ASLayoutRangeType)rangeType -{ - ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssert(rangeType == ASLayoutRangeTypeDisplay, @"Render delegate should not handle other ranges"); - - // If a node had previously been onscreen but now is only in the working range, - // ensure its view is not orphaned in a UITableViewCell in the reuse pool. - if (![node isLayerBacked] && node.view.superview) { - [node.view removeFromSuperview]; - } - - // The node un-suspends display. - [node enterInterfaceState:ASInterfaceStateDisplay]; - - -// ASDisplayNodeAssert(![ASDisplayNode shouldUseNewRenderingRange], @"It should no longer be possible to reach this point with the new display range enabled"); - [node recursivelyEnsureDisplaySynchronously:NO]; -} - -- (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType -{ - ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssert(rangeType == ASLayoutRangeTypeDisplay, @"Render delegate should not handle other ranges"); - - // This code is tricky. There are several possible states a node can be in when it reaches this point. - // 1. Layer-backed vs view-backed nodes. AS of this writing, only ASCellNodes arrive here, which are always view-backed — - // but we maintain correctness for all ASDisplayNodes, including layer-backed ones. - // (Note: it would not make sense to pass in a subnode of a rasterized node here, so that is unsupported). - // 2. The node's layer may have been added to the workingWindow previously, or it may have never been added, such as if rangeTuningParameter's leading value is 0. - // 3. The node's layer may not be present in the workingWindow, even if it was previously added. - // This is a common case, as once the node is added to an active cell contentsView (e.g. visible), it is automatically removed from the workingWindow. - // The system does this when addSublayer is called, even if removeFromSuperlayer is never explicitly called. - // 4. Lastly and most unusually, it is possible for a node to be offscreen, completely outside the heirarchy, and yet considered within the working range. - // This happens if the UITableViewCell is reused after scrolling offscreen. Because the node has already been given the opportunity to display, we do not - // proactively re-host it within the workingWindow (improving efficiency). Some time later, it may fall outside the working range, in which case calling - // -recursivelyClearContents is critical. If the user scrolls back and it is re-hosted in a UITableViewCell, the content will still exist as it is not cleared - // by simply being removed from the cell. The code that usually triggers this condition is the -removeFromSuperview in -[ASRangeController configureContentView:forCellNode:]. - // Condition #4 is suboptimal in some cases, as it is conceivable that memory warnings could trigger clearing content that is inside the working range. However, enforcing the - // preservation of this content could result in the app being killed, which is not likely preferable over briefly seeing placeholders in the event the user scrolls backwards. - // Nonetheless, future changes to the implementation will likely eliminate this behavior to simplify debugging and extensibility of working range functionality. - - // The node calls clearCurrentContents and suspends display - [node exitInterfaceState:ASInterfaceStateDisplay]; - -// ASDisplayNodeAssert(![ASDisplayNode shouldUseNewRenderingRange], @"It should no longer be possible to reach this point with the new display range enabled"); - if (![node isLayerBacked]) { - [node.view removeFromSuperview]; - } else { - [node.layer removeFromSuperlayer]; - } -} - -@end diff --git a/AsyncDisplayKit/Details/ASRangeHandlerVisible.h b/AsyncDisplayKit/Details/ASRangeHandlerVisible.h deleted file mode 100644 index eab9f77f29..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandlerVisible.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#import - -@interface ASRangeHandlerVisible : NSObject - -@end diff --git a/AsyncDisplayKit/Details/ASRangeHandlerVisible.mm b/AsyncDisplayKit/Details/ASRangeHandlerVisible.mm deleted file mode 100644 index f17bc1cad3..0000000000 --- a/AsyncDisplayKit/Details/ASRangeHandlerVisible.mm +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "ASRangeHandlerVisible.h" -#import "ASDisplayNode.h" -#import "ASDisplayNode+FrameworkPrivate.h" - -@implementation ASRangeHandlerVisible - -- (void)node:(ASDisplayNode *)node enteredRangeOfType:(ASLayoutRangeType)rangeType -{ - [node enterInterfaceState:ASInterfaceStateVisible]; -} - -- (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType -{ - [node exitInterfaceState:ASInterfaceStateVisible]; -} - -@end