mirror of
https://github.com/TextureGroup/Texture.git
synced 2026-04-07 19:17:39 +00:00
Renames AS_EXTERN and ASViewController (#1876)
* Renames AS_EXTERN and ASViewController To ASDK_EXTERN and ASDKViewController. This is to avoid conflicting with AuthenticationServices in Xcode 12 * Fix up examples and docs * Add bit about updating ASViewController rename
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
254C6B8C1BF94F8A003EC431 /* ASTextKitTailTruncater.mm in Sources */ = {isa = PBXBuildFile; fileRef = 257754A21BEE44CD00737CA5 /* ASTextKitTailTruncater.mm */; };
|
||||
25E327571C16819500A2170C /* ASPagerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 25E327541C16819500A2170C /* ASPagerNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
25E327591C16819500A2170C /* ASPagerNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 25E327551C16819500A2170C /* ASPagerNode.mm */; };
|
||||
2767E9411BB19BD600EA9B77 /* ASViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2767E9411BB19BD600EA9B77 /* ASDKViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = ACC945A81BA9E7A0005E1FB8 /* ASDKViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
2911485C1A77147A005D0878 /* ASControlNodeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2911485B1A77147A005D0878 /* ASControlNodeTests.mm */; };
|
||||
296A0A351A951ABF005ACEAA /* ASBatchFetchingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 296A0A341A951ABF005ACEAA /* ASBatchFetchingTests.mm */; };
|
||||
29CDC2E21AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CDC2E11AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.mm */; };
|
||||
@@ -198,7 +198,7 @@
|
||||
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, ); }; };
|
||||
9C70F2091CDABA36007D6C76 /* ASViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */; };
|
||||
9C70F2091CDABA36007D6C76 /* ASDKViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6BF1CCAC73C006A6476 /* ASDKViewController.mm */; };
|
||||
9C70F20A1CDBE949007D6C76 /* ASTableNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6C11CCAC768006A6476 /* ASTableNode.mm */; };
|
||||
9C70F20D1CDBE9CB007D6C76 /* ASDefaultPlayButton.h in Headers */ = {isa = PBXBuildFile; fileRef = AEB7B0181C5962EA00662EF4 /* ASDefaultPlayButton.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||
9C70F20E1CDBE9E5007D6C76 /* NSArray+Diffing.h in Headers */ = {isa = PBXBuildFile; fileRef = DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -390,7 +390,7 @@
|
||||
CC8B05D61D73836400F54286 /* ASPerformanceTestContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC8B05D51D73836400F54286 /* ASPerformanceTestContext.mm */; };
|
||||
CC8B05D81D73979700F54286 /* ASTextNodePerformanceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC8B05D71D73979700F54286 /* ASTextNodePerformanceTests.mm */; };
|
||||
CC90E1F41E383C0400FED591 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */; };
|
||||
CCA221D31D6FA7EF00AF6A0F /* ASViewControllerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CCA221D21D6FA7EF00AF6A0F /* ASViewControllerTests.mm */; };
|
||||
CCA221D31D6FA7EF00AF6A0F /* ASDKViewControllerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CCA221D21D6FA7EF00AF6A0F /* ASDKViewControllerTests.mm */; };
|
||||
CCA282B41E9EA7310037E8B7 /* ASTipsController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCA282B21E9EA7310037E8B7 /* ASTipsController.h */; };
|
||||
CCA282B51E9EA7310037E8B7 /* ASTipsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CCA282B31E9EA7310037E8B7 /* ASTipsController.mm */; };
|
||||
CCA282B81E9EA8E40037E8B7 /* AsyncDisplayKit+Tips.h in Headers */ = {isa = PBXBuildFile; fileRef = CCA282B61E9EA8E40037E8B7 /* AsyncDisplayKit+Tips.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@@ -779,7 +779,7 @@
|
||||
9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTraitCollection.mm; sourceTree = "<group>"; };
|
||||
9C8898BA1C738B9800D6B02E /* ASTextKitFontSizeAdjuster.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASTextKitFontSizeAdjuster.mm; path = TextKit/ASTextKitFontSizeAdjuster.mm; sourceTree = "<group>"; };
|
||||
9CDC18CB1B910E12004965E2 /* ASLayoutElementPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutElementPrivate.h; sourceTree = "<group>"; };
|
||||
9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASViewController.mm; sourceTree = "<group>"; };
|
||||
9CFFC6BF1CCAC73C006A6476 /* ASDKViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDKViewController.mm; sourceTree = "<group>"; };
|
||||
9CFFC6C11CCAC768006A6476 /* ASTableNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTableNode.mm; sourceTree = "<group>"; };
|
||||
9D302F9A2231B07E005739C3 /* ASButtonNode+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASButtonNode+Private.h"; sourceTree = "<group>"; };
|
||||
9D302F9C2231B373005739C3 /* ASButtonNode+Yoga.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASButtonNode+Yoga.h"; sourceTree = "<group>"; };
|
||||
@@ -803,7 +803,7 @@
|
||||
AC6145421D8AFD4F003D62A2 /* ASSection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASSection.mm; path = ../Private/ASSection.mm; sourceTree = "<group>"; };
|
||||
AC6456071B0A335000CF11B8 /* ASCellNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCellNode.mm; sourceTree = "<group>"; };
|
||||
AC7A2C161BDE11DF0093FE1A /* ASTableViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTableViewInternal.h; sourceTree = "<group>"; };
|
||||
ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASViewController.h; sourceTree = "<group>"; };
|
||||
ACC945A81BA9E7A0005E1FB8 /* ASDKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDKViewController.h; sourceTree = "<group>"; };
|
||||
ACE87A2B1D73696800D7FF06 /* ASSectionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASSectionContext.h; path = Details/ASSectionContext.h; sourceTree = "<group>"; };
|
||||
ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASBackgroundLayoutSpec.h; sourceTree = "<group>"; };
|
||||
ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASBackgroundLayoutSpec.mm; sourceTree = "<group>"; };
|
||||
@@ -923,7 +923,7 @@
|
||||
CC8B05D41D73836400F54286 /* ASPerformanceTestContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPerformanceTestContext.h; sourceTree = "<group>"; };
|
||||
CC8B05D51D73836400F54286 /* ASPerformanceTestContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASPerformanceTestContext.mm; sourceTree = "<group>"; };
|
||||
CC8B05D71D73979700F54286 /* ASTextNodePerformanceTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTextNodePerformanceTests.mm; sourceTree = "<group>"; };
|
||||
CCA221D21D6FA7EF00AF6A0F /* ASViewControllerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASViewControllerTests.mm; sourceTree = "<group>"; };
|
||||
CCA221D21D6FA7EF00AF6A0F /* ASDKViewControllerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDKViewControllerTests.mm; sourceTree = "<group>"; };
|
||||
CCA282B21E9EA7310037E8B7 /* ASTipsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTipsController.h; sourceTree = "<group>"; };
|
||||
CCA282B31E9EA7310037E8B7 /* ASTipsController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTipsController.mm; sourceTree = "<group>"; };
|
||||
CCA282B61E9EA8E40037E8B7 /* AsyncDisplayKit+Tips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AsyncDisplayKit+Tips.h"; sourceTree = "<group>"; };
|
||||
@@ -1275,8 +1275,8 @@
|
||||
AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */,
|
||||
8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */,
|
||||
8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */,
|
||||
ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */,
|
||||
9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */,
|
||||
ACC945A81BA9E7A0005E1FB8 /* ASDKViewController.h */,
|
||||
9CFFC6BF1CCAC73C006A6476 /* ASDKViewController.mm */,
|
||||
68FC85E71CE29C7D00EDD713 /* ASVisibilityProtocols.h */,
|
||||
68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.mm */,
|
||||
6BDC61F51978FEA400E50D21 /* AsyncDisplayKit.h */,
|
||||
@@ -1386,7 +1386,7 @@
|
||||
D933F040224AD17F00FF495E /* ASTransactionTests.mm */,
|
||||
CC0AEEA31D66316E005D1C78 /* ASUICollectionViewTests.mm */,
|
||||
AEEC47E31C21D3D200EC1693 /* ASVideoNodeTests.mm */,
|
||||
CCA221D21D6FA7EF00AF6A0F /* ASViewControllerTests.mm */,
|
||||
CCA221D21D6FA7EF00AF6A0F /* ASDKViewControllerTests.mm */,
|
||||
83A7D95D1D446A6E00BF333E /* ASWeakMapTests.mm */,
|
||||
CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.mm */,
|
||||
695BE2541DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm */,
|
||||
@@ -2107,7 +2107,7 @@
|
||||
CCA282B41E9EA7310037E8B7 /* ASTipsController.h in Headers */,
|
||||
34EFC7711B701CFF00AD841F /* ASStackLayoutSpec.h in Headers */,
|
||||
CCA282C01E9EAE010037E8B7 /* ASTip.h in Headers */,
|
||||
2767E9411BB19BD600EA9B77 /* ASViewController.h in Headers */,
|
||||
2767E9411BB19BD600EA9B77 /* ASDKViewController.h in Headers */,
|
||||
92DD2FE81BF4D0A80074C9DD /* ASMapNode.h in Headers */,
|
||||
9C6BB3B31B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h in Headers */,
|
||||
34EFC7731B701D0700AD841F /* ASAbsoluteLayoutSpec.h in Headers */,
|
||||
@@ -2330,7 +2330,7 @@
|
||||
ACF6ED5D1B178DC700DA7C62 /* ASDimensionTests.mm in Sources */,
|
||||
BB5FC3D11F9C9389007F191E /* ASTabBarControllerTests.mm in Sources */,
|
||||
695BE2551DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm in Sources */,
|
||||
CCA221D31D6FA7EF00AF6A0F /* ASViewControllerTests.mm in Sources */,
|
||||
CCA221D31D6FA7EF00AF6A0F /* ASDKViewControllerTests.mm in Sources */,
|
||||
058D0A38195D057000B7D73C /* ASDisplayLayerTests.mm in Sources */,
|
||||
2538B6F31BC5D2A2003CA0B4 /* ASCollectionViewFlowLayoutInspectorTests.mm in Sources */,
|
||||
CC583AD61EF9BDBE00134156 /* ASTestCase.mm in Sources */,
|
||||
@@ -2405,7 +2405,7 @@
|
||||
DEB8ED7C1DD003D300DBDE55 /* ASLayoutTransition.mm in Sources */,
|
||||
CCA5F62E1EECC2A80060C137 /* ASAssert.mm in Sources */,
|
||||
9F98C0261DBE29E000476D92 /* ASControlTargetAction.mm in Sources */,
|
||||
9C70F2091CDABA36007D6C76 /* ASViewController.mm in Sources */,
|
||||
9C70F2091CDABA36007D6C76 /* ASDKViewController.mm in Sources */,
|
||||
3917EBD51E9C2FC400D04A01 /* _ASCollectionReusableView.mm in Sources */,
|
||||
CCA282D11E9EBF6C0037E8B7 /* ASTipsWindow.mm in Sources */,
|
||||
CCCCCCE41EC3EF060087FE10 /* NSParagraphStyle+ASText.mm in Sources */,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#import <AsyncDisplayKit/ASTextNode.h>
|
||||
#import <AsyncDisplayKit/ASCollectionNode.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
_viewController = _viewControllerBlock();
|
||||
_viewControllerBlock = nil;
|
||||
|
||||
if ([_viewController isKindOfClass:[ASViewController class]]) {
|
||||
ASViewController *asViewController = (ASViewController *)_viewController;
|
||||
if ([_viewController isKindOfClass:[ASDKViewController class]]) {
|
||||
ASDKViewController *asViewController = (ASDKViewController *)_viewController;
|
||||
_viewControllerNode = asViewController.node;
|
||||
[_viewController loadViewIfNeeded];
|
||||
} else {
|
||||
|
||||
@@ -34,12 +34,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* Internal function. Use the macro without the underbar.
|
||||
*/
|
||||
AS_EXTERN BOOL _ASActivateExperimentalFeature(ASExperimentalFeatures option);
|
||||
ASDK_EXTERN BOOL _ASActivateExperimentalFeature(ASExperimentalFeatures option);
|
||||
|
||||
/**
|
||||
* Notify the configuration delegate that the framework initialized, if needed.
|
||||
*/
|
||||
AS_EXTERN void ASNotifyInitialized(void);
|
||||
ASDK_EXTERN void ASNotifyInitialized(void);
|
||||
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASConfigurationManager : NSObject
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN NSString * const ASTransitionContextFromLayoutKey;
|
||||
AS_EXTERN NSString * const ASTransitionContextToLayoutKey;
|
||||
ASDK_EXTERN NSString * const ASTransitionContextFromLayoutKey;
|
||||
ASDK_EXTERN NSString * const ASTransitionContextToLayoutKey;
|
||||
|
||||
@protocol ASContextTransitioning <NSObject>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ASViewController.h
|
||||
// ASDKViewController.h
|
||||
// Texture
|
||||
//
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
||||
@@ -19,29 +19,29 @@ typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitCollectionBlock)(U
|
||||
typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitWindowSizeBlock)(CGSize windowSize);
|
||||
|
||||
/**
|
||||
* ASViewController allows you to have a completely node backed hierarchy. It automatically
|
||||
* ASDKViewController allows you to have a completely node backed hierarchy. It automatically
|
||||
* handles @c ASVisibilityDepth, automatic range mode and propogating @c ASDisplayTraits to contained nodes.
|
||||
*
|
||||
* You can opt-out of node backed hierarchy and use it like a normal UIViewController.
|
||||
* More importantly, you can use it as a base class for all of your view controllers among which some use a node hierarchy and some don't.
|
||||
* See examples/ASDKgram project for actual implementation.
|
||||
*/
|
||||
@interface ASViewController<__covariant DisplayNodeType : ASDisplayNode *> : UIViewController <ASVisibilityDepth>
|
||||
@interface ASDKViewController<__covariant DisplayNodeType : ASDisplayNode *> : UIViewController <ASVisibilityDepth>
|
||||
|
||||
/**
|
||||
* ASViewController initializer.
|
||||
* ASDKViewController initializer.
|
||||
*
|
||||
* @param node An ASDisplayNode which will provide the root view (self.view)
|
||||
* @return An ASViewController instance whose root view will be backed by the provided ASDisplayNode.
|
||||
* @return An ASDKViewController instance whose root view will be backed by the provided ASDisplayNode.
|
||||
*
|
||||
* @see ASVisibilityDepth
|
||||
*/
|
||||
- (instancetype)initWithNode:(DisplayNodeType)node NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* ASViewController initializer. Useful for interoperability with normal UIViewControllers.
|
||||
* ASDKViewController initializer. Useful for interoperability with normal UIViewControllers.
|
||||
*
|
||||
* @return An ASViewController instance with a nil node whose root view will be backed by a standard UIView as with a normal UIViewController.
|
||||
* @return An ASDKViewController instance with a nil node whose root view will be backed by a standard UIView as with a normal UIViewController.
|
||||
*
|
||||
* @see ASVisibilityDepth
|
||||
*/
|
||||
@@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@end
|
||||
|
||||
@interface ASViewController (ASRangeControllerUpdateRangeProtocol)
|
||||
@interface ASDKViewController (ASRangeControllerUpdateRangeProtocol)
|
||||
|
||||
/**
|
||||
* Automatically adjust range mode based on view events. If you set this to YES, the view controller or its node
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ASViewController.mm
|
||||
// ASDKViewController.mm
|
||||
// Texture
|
||||
//
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
||||
@@ -7,14 +7,14 @@
|
||||
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNode+FrameworkPrivate.h>
|
||||
#import <AsyncDisplayKit/ASLog.h>
|
||||
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
|
||||
#import <AsyncDisplayKit/ASInternalHelpers.h>
|
||||
#import <AsyncDisplayKit/ASConfigurationInternal.h>
|
||||
|
||||
@implementation ASViewController
|
||||
@implementation ASDKViewController
|
||||
{
|
||||
BOOL _ensureDisplayed;
|
||||
BOOL _automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
@@ -185,7 +185,7 @@ ASVisibilityDidMoveToParentViewController;
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
as_activity_create_for_scope("ASViewController will appear");
|
||||
as_activity_create_for_scope("ASDKViewController will appear");
|
||||
os_log_debug(ASNodeLog(), "View controller %@ will appear", self);
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
@@ -323,13 +323,13 @@ ASVisibilityDepthImplementation;
|
||||
ASPrimitiveTraitCollection oldTraitCollection = self.node.primitiveTraitCollection;
|
||||
|
||||
if (ASPrimitiveTraitCollectionIsEqualToASPrimitiveTraitCollection(traitCollection, oldTraitCollection) == NO) {
|
||||
as_activity_scope_verbose(as_activity_create("Propagate ASViewController trait collection", AS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT));
|
||||
as_activity_scope_verbose(as_activity_create("Propagate ASDKViewController trait collection", AS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT));
|
||||
os_log_debug(ASNodeLog(), "Propagating new traits for %@: %@", self, NSStringFromASPrimitiveTraitCollection(traitCollection));
|
||||
ASTraitCollectionPropagateDown(self.node, traitCollection);
|
||||
|
||||
// Once we've propagated all the traits, layout this node.
|
||||
// Remeasure the node with the latest constrained size – old constrained size may be incorrect.
|
||||
as_activity_scope_verbose(as_activity_create("Layout ASViewController node with new traits", AS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT));
|
||||
as_activity_scope_verbose(as_activity_create("Layout ASDKViewController node with new traits", AS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT));
|
||||
[_node layoutThatFits:[self nodeConstrainedSize]];
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN void ASPerformBlockOnMainThread(void (^block)(void));
|
||||
AS_EXTERN void ASPerformBlockOnBackgroundThread(void (^block)(void)); // DISPATCH_QUEUE_PRIORITY_DEFAULT
|
||||
ASDK_EXTERN void ASPerformBlockOnMainThread(void (^block)(void));
|
||||
ASDK_EXTERN void ASPerformBlockOnBackgroundThread(void (^block)(void)); // DISPATCH_QUEUE_PRIORITY_DEFAULT
|
||||
|
||||
/**
|
||||
* Bitmask to indicate what performance measurements the cell should record.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* 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).
|
||||
*
|
||||
|
||||
@@ -298,7 +298,7 @@ ASLayoutElementStyleExtensibilityForwarding
|
||||
// TODO
|
||||
// We should remove this logic, which is relatively new, and instead
|
||||
// rely on the parent / host of the root node to do this size change. That's always been the
|
||||
// expectation with other node containers like ASTableView, ASCollectionView, ASViewController, etc.
|
||||
// expectation with other node containers like ASTableView, ASCollectionView, ASDKViewController, etc.
|
||||
// E.g. in ASCellNode the _interactionDelegate is a Table or Collection that will resize in this
|
||||
// case. By resizing without participating with the parent, we could get cases where our parent size
|
||||
// does not match, especially if there is a size constraint that is applied at that level.
|
||||
|
||||
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class ASLayout;
|
||||
|
||||
AS_EXTERN void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable node, void(^block)(ASDisplayNode *node));
|
||||
ASDK_EXTERN void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode * _Nullable node, void(^block)(ASDisplayNode *node));
|
||||
|
||||
@interface ASDisplayNode (Yoga)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ typedef NS_ENUM(unsigned char, ASCornerRoundingType) {
|
||||
/**
|
||||
* Default drawing priority for display node
|
||||
*/
|
||||
AS_EXTERN NSInteger const ASDefaultDrawingPriority;
|
||||
ASDK_EXTERN NSInteger const ASDefaultDrawingPriority;
|
||||
|
||||
/**
|
||||
* An `ASDisplayNode` is an abstraction over `UIView` and `CALayer` that allows you to perform calculations about a view
|
||||
|
||||
@@ -1377,7 +1377,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
||||
{
|
||||
// This recursion must handle layers in various states:
|
||||
// 1. Just added to hierarchy, CA hasn't yet called -display
|
||||
// 2. Previously in a hierarchy (such as a working window owned by an Intelligent Preloading class, like ASTableView / ASCollectionView / ASViewController)
|
||||
// 2. Previously in a hierarchy (such as a working window owned by an Intelligent Preloading class, like ASTableView / ASCollectionView / ASDKViewController)
|
||||
// 3. Has no content to display at all
|
||||
// Specifically for case 1), we need to explicitly trigger a -display call now.
|
||||
// Otherwise, there is no opportunity to block the main thread after CoreAnimation's transaction commit
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// For deallocation of objects on the main thread across multiple run loops.
|
||||
AS_EXTERN void ASPerformMainThreadDeallocation(id _Nullable __strong * _Nonnull objectPtr);
|
||||
ASDK_EXTERN void ASPerformMainThreadDeallocation(id _Nullable __strong * _Nonnull objectPtr);
|
||||
|
||||
// Because inline methods can't be extern'd and need to be part of the translation unit of code
|
||||
// that compiles with them to actually inline, we both declare and define these in the header.
|
||||
@@ -101,22 +101,22 @@ __unused static NSString *NSStringFromASInterfaceStateChange(ASInterfaceState ol
|
||||
/**
|
||||
Returns the appropriate interface state for a given ASDisplayNode and window
|
||||
*/
|
||||
AS_EXTERN ASInterfaceState ASInterfaceStateForDisplayNode(ASDisplayNode *displayNode, UIWindow *window) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASInterfaceState ASInterfaceStateForDisplayNode(ASDisplayNode *displayNode, UIWindow *window) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a layer, returns the associated display node, if any.
|
||||
*/
|
||||
AS_EXTERN ASDisplayNode * _Nullable ASLayerToDisplayNode(CALayer * _Nullable layer) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASDisplayNode * _Nullable ASLayerToDisplayNode(CALayer * _Nullable layer) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a view, returns the associated display node, if any.
|
||||
*/
|
||||
AS_EXTERN ASDisplayNode * _Nullable ASViewToDisplayNode(UIView * _Nullable view) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASDisplayNode * _Nullable ASViewToDisplayNode(UIView * _Nullable view) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a node, returns the root of the node hierarchy (where supernode == nil)
|
||||
*/
|
||||
AS_EXTERN ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
If traverseSublayers == YES, this function will walk the layer hierarchy, spanning discontinuous sections of the node hierarchy\
|
||||
@@ -124,39 +124,39 @@ AS_EXTERN ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node)
|
||||
In the event that a node's backing layer is not created yet, the function will only walk the direct subnodes instead
|
||||
of forcing the layer hierarchy to be created.
|
||||
*/
|
||||
AS_EXTERN void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node));
|
||||
ASDK_EXTERN void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node));
|
||||
|
||||
/**
|
||||
This function will walk the node hierarchy in a breadth first fashion. It does run the block on the node provided
|
||||
directly to the function call. It does NOT traverse sublayers.
|
||||
*/
|
||||
AS_EXTERN void ASDisplayNodePerformBlockOnEveryNodeBFS(ASDisplayNode *node, void(^block)(ASDisplayNode *node));
|
||||
ASDK_EXTERN void ASDisplayNodePerformBlockOnEveryNodeBFS(ASDisplayNode *node, void(^block)(ASDisplayNode *node));
|
||||
|
||||
/**
|
||||
Identical to ASDisplayNodePerformBlockOnEveryNode, except it does not run the block on the
|
||||
node provided directly to the function call - only on all descendants.
|
||||
*/
|
||||
AS_EXTERN void ASDisplayNodePerformBlockOnEverySubnode(ASDisplayNode *node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node));
|
||||
ASDK_EXTERN void ASDisplayNodePerformBlockOnEverySubnode(ASDisplayNode *node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node));
|
||||
|
||||
/**
|
||||
Given a display node, traverses up the layer tree hierarchy, returning the first display node that passes block.
|
||||
*/
|
||||
AS_EXTERN ASDisplayNode * _Nullable ASDisplayNodeFindFirstSupernode(ASDisplayNode * _Nullable node, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use the `supernodes` property instead.");
|
||||
ASDK_EXTERN ASDisplayNode * _Nullable ASDisplayNodeFindFirstSupernode(ASDisplayNode * _Nullable node, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use the `supernodes` property instead.");
|
||||
|
||||
/**
|
||||
Given a display node, traverses up the layer tree hierarchy, returning the first display node of kind class.
|
||||
*/
|
||||
AS_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSupernodeOfClass(ASDisplayNode *start, Class c) AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use the `supernodeOfClass:includingSelf:` method instead.");
|
||||
ASDK_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSupernodeOfClass(ASDisplayNode *start, Class c) AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use the `supernodeOfClass:includingSelf:` method instead.");
|
||||
|
||||
/**
|
||||
* Given a layer, find the window it lives in, if any.
|
||||
*/
|
||||
AS_EXTERN UIWindow * _Nullable ASFindWindowOfLayer(CALayer *layer) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN UIWindow * _Nullable ASFindWindowOfLayer(CALayer *layer) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Given a layer, find the closest view it lives in, if any.
|
||||
*/
|
||||
AS_EXTERN UIView * _Nullable ASFindClosestViewOfLayer(CALayer *layer) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN UIView * _Nullable ASFindClosestViewOfLayer(CALayer *layer) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Given two nodes, finds their most immediate common parent. Used for geometry conversion methods.
|
||||
@@ -166,48 +166,48 @@ AS_EXTERN UIView * _Nullable ASFindClosestViewOfLayer(CALayer *layer) AS_WARN_UN
|
||||
* undefined and undocumented behavior of UIKit in ASDisplayNode, this operation is defined to be incorrect in all
|
||||
* circumstances and must be fixed wherever encountered.
|
||||
*/
|
||||
AS_EXTERN ASDisplayNode * _Nullable ASDisplayNodeFindClosestCommonAncestor(ASDisplayNode *node1, ASDisplayNode *node2) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASDisplayNode * _Nullable ASDisplayNodeFindClosestCommonAncestor(ASDisplayNode *node1, ASDisplayNode *node2) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a display node, collects all descendants. This is a specialization of ASCollectContainer() that walks the Core Animation layer tree as opposed to the display node tree, thus supporting non-continues display node hierarchies.
|
||||
*/
|
||||
AS_EXTERN NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a display node, traverses down the node hierarchy, returning all the display nodes that pass the block.
|
||||
*/
|
||||
AS_EXTERN NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a display node, traverses down the node hierarchy, returning all the display nodes of kind class.
|
||||
*/
|
||||
AS_EXTERN NSArray<__kindof ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSArray<__kindof ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a display node, traverses down the node hierarchy, returning the depth-first display node, including the start node that pass the block.
|
||||
*/
|
||||
AS_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstNode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstNode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a display node, traverses down the node hierarchy, returning the depth-first display node, excluding the start node, that pass the block
|
||||
*/
|
||||
AS_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSubnode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSubnode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Given a display node, traverses down the node hierarchy, returning the depth-first display node of kind class.
|
||||
*/
|
||||
AS_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
AS_EXTERN UIColor *ASDisplayNodeDefaultPlaceholderColor(void) AS_WARN_UNUSED_RESULT;
|
||||
AS_EXTERN UIColor *ASDisplayNodeDefaultTintColor(void) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN UIColor *ASDisplayNodeDefaultPlaceholderColor(void) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN UIColor *ASDisplayNodeDefaultTintColor(void) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
Disable willAppear / didAppear / didDisappear notifications for a sub-hierarchy, then re-enable when done. Nested calls are supported.
|
||||
*/
|
||||
AS_EXTERN void ASDisplayNodeDisableHierarchyNotifications(ASDisplayNode *node);
|
||||
AS_EXTERN void ASDisplayNodeEnableHierarchyNotifications(ASDisplayNode *node);
|
||||
ASDK_EXTERN void ASDisplayNodeDisableHierarchyNotifications(ASDisplayNode *node);
|
||||
ASDK_EXTERN void ASDisplayNodeEnableHierarchyNotifications(ASDisplayNode *node);
|
||||
|
||||
// Not to be called directly.
|
||||
AS_EXTERN void _ASSetDebugNames(Class owningClass, NSString *names, ASDisplayNode * _Nullable object, ...);
|
||||
ASDK_EXTERN void _ASSetDebugNames(Class owningClass, NSString *names, ASDisplayNode * _Nullable object, ...);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -33,9 +33,9 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
|
||||
};
|
||||
|
||||
/// Convert flags -> name array.
|
||||
AS_EXTERN NSArray<NSString *> *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags);
|
||||
ASDK_EXTERN NSArray<NSString *> *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags);
|
||||
|
||||
/// Convert name array -> flags.
|
||||
AS_EXTERN ASExperimentalFeatures ASExperimentalFeaturesFromArray(NSArray<NSString *> *array);
|
||||
ASDK_EXTERN ASExperimentalFeatures ASExperimentalFeaturesFromArray(NSArray<NSString *> *array);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -195,7 +195,7 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image,
|
||||
*
|
||||
* @return An ASImageNode image modification block.
|
||||
*/
|
||||
AS_EXTERN asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor * _Nullable borderColor);
|
||||
ASDK_EXTERN asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor * _Nullable borderColor);
|
||||
|
||||
/**
|
||||
* @abstract Image modification block that applies a tint color à la UIImage configured with
|
||||
@@ -207,6 +207,6 @@ AS_EXTERN asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlo
|
||||
*
|
||||
* @return An ASImageNode image modification block.
|
||||
*/
|
||||
AS_EXTERN asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UIColor *color);
|
||||
ASDK_EXTERN asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UIColor *color);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef id<NSCopying, NSObject> ASImageIdentifier;
|
||||
|
||||
AS_EXTERN NSString *const ASMultiplexImageNodeErrorDomain;
|
||||
ASDK_EXTERN NSString *const ASMultiplexImageNodeErrorDomain;
|
||||
|
||||
/**
|
||||
* ASMultiplexImageNode error codes.
|
||||
|
||||
@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @discussion ASNavigationController 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 ASNavigationController with regular UIViewControllers, as well as ASDKViewControllers.
|
||||
* It is safe to subclass or use even where AsyncDisplayKit is not adopted.
|
||||
*
|
||||
* @see ASManagesChildVisibilityDepth
|
||||
|
||||
@@ -14,13 +14,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class UIViewController;
|
||||
|
||||
AS_EXTERN ASLayoutRangeMode ASLayoutRangeModeForVisibilityDepth(NSUInteger visibilityDepth);
|
||||
ASDK_EXTERN ASLayoutRangeMode ASLayoutRangeModeForVisibilityDepth(NSUInteger visibilityDepth);
|
||||
|
||||
/**
|
||||
* ASVisibilityDepth
|
||||
*
|
||||
* @discussion "Visibility Depth" represents the number of user actions required to make an ASDisplayNode or
|
||||
* ASViewController visibile. AsyncDisplayKit uses this information to intelligently manage memory and focus
|
||||
* ASDKViewController visibile. AsyncDisplayKit 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.
|
||||
@@ -55,11 +55,11 @@ AS_EXTERN ASLayoutRangeMode ASLayoutRangeModeForVisibilityDepth(NSUInteger visib
|
||||
* If implemented by a view controller container, use this method to notify child view controllers that their view
|
||||
* depth has changed @see ASNavigationController.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).
|
||||
*
|
||||
* @see visibilityDepth
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#import <AsyncDisplayKit/ASPagerNode+Beta.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASNodeController+Beta.h>
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import <AsyncDisplayKit/ASNavigationController.h>
|
||||
#import <AsyncDisplayKit/ASTabBarController.h>
|
||||
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
|
||||
|
||||
@@ -74,11 +74,11 @@
|
||||
*/
|
||||
#pragma mark - Main Thread Assertions Disabling
|
||||
|
||||
AS_EXTERN BOOL ASMainThreadAssertionsAreDisabled(void);
|
||||
ASDK_EXTERN BOOL ASMainThreadAssertionsAreDisabled(void);
|
||||
|
||||
AS_EXTERN void ASPushMainThreadAssertionsDisabled(void);
|
||||
ASDK_EXTERN void ASPushMainThreadAssertionsDisabled(void);
|
||||
|
||||
AS_EXTERN void ASPopMainThreadAssertionsDisabled(void);
|
||||
ASDK_EXTERN void ASPopMainThreadAssertionsDisabled(void);
|
||||
|
||||
#pragma mark - Non-Fatal Assertions
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#define AS_EXTERN FOUNDATION_EXTERN
|
||||
#define ASDK_EXTERN FOUNDATION_EXTERN
|
||||
#define unowned __unsafe_unretained
|
||||
|
||||
/**
|
||||
|
||||
+10
-10
@@ -30,7 +30,7 @@
|
||||
* are at the `debug` log level, which the system
|
||||
* disables in production.
|
||||
*/
|
||||
AS_EXTERN void ASDisableLogging(void);
|
||||
ASDK_EXTERN void ASDisableLogging(void);
|
||||
|
||||
/**
|
||||
* Restore logging that has been runtime-disabled via ASDisableLogging().
|
||||
@@ -40,38 +40,38 @@ AS_EXTERN void ASDisableLogging(void);
|
||||
* configuration. This can be used in conjunction with ASDisableLogging()
|
||||
* to allow logging to be toggled off and back on at runtime.
|
||||
*/
|
||||
AS_EXTERN void ASEnableLogging(void);
|
||||
ASDK_EXTERN void ASEnableLogging(void);
|
||||
|
||||
/// Log for general node events e.g. interfaceState, didLoad.
|
||||
#define ASNodeLogEnabled 1
|
||||
AS_EXTERN os_log_t ASNodeLog(void);
|
||||
ASDK_EXTERN os_log_t ASNodeLog(void);
|
||||
|
||||
/// Log for layout-specific events e.g. calculateLayout.
|
||||
#define ASLayoutLogEnabled 1
|
||||
AS_EXTERN os_log_t ASLayoutLog(void);
|
||||
ASDK_EXTERN os_log_t ASLayoutLog(void);
|
||||
|
||||
/// Log for display-specific events e.g. display queue batches.
|
||||
#define ASDisplayLogEnabled 1
|
||||
AS_EXTERN os_log_t ASDisplayLog(void);
|
||||
ASDK_EXTERN os_log_t ASDisplayLog(void);
|
||||
|
||||
/// Log for collection events e.g. reloadData, performBatchUpdates.
|
||||
#define ASCollectionLogEnabled 1
|
||||
AS_EXTERN os_log_t ASCollectionLog(void);
|
||||
ASDK_EXTERN os_log_t ASCollectionLog(void);
|
||||
|
||||
/// Log for ASNetworkImageNode and ASMultiplexImageNode events.
|
||||
#define ASImageLoadingLogEnabled 1
|
||||
AS_EXTERN os_log_t ASImageLoadingLog(void);
|
||||
ASDK_EXTERN os_log_t ASImageLoadingLog(void);
|
||||
|
||||
/// Specialized log for our main thread deallocation trampoline.
|
||||
#define ASMainThreadDeallocationLogEnabled 0
|
||||
AS_EXTERN os_log_t ASMainThreadDeallocationLog(void);
|
||||
ASDK_EXTERN os_log_t ASMainThreadDeallocationLog(void);
|
||||
|
||||
#define ASLockingLogEnabled 0
|
||||
AS_EXTERN os_log_t ASLockingLog(void);
|
||||
ASDK_EXTERN os_log_t ASLockingLog(void);
|
||||
|
||||
#if AS_HAS_OS_SIGNPOST
|
||||
/// Uses the special POI category for Instruments. Used by ASSignpost.h.
|
||||
AS_EXTERN os_log_t ASPointsOfInterestLog(void);
|
||||
ASDK_EXTERN os_log_t ASPointsOfInterestLog(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferHorizontal(ASScrollDirection scrollDirection, ASRangeTuningParameters rangeTuningParameters);
|
||||
ASDK_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferHorizontal(ASScrollDirection scrollDirection, ASRangeTuningParameters rangeTuningParameters);
|
||||
|
||||
AS_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferVertical(ASScrollDirection scrollDirection, ASRangeTuningParameters rangeTuningParameters);
|
||||
ASDK_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferVertical(ASScrollDirection scrollDirection, ASRangeTuningParameters rangeTuningParameters);
|
||||
|
||||
AS_EXTERN CGRect CGRectExpandToRangeWithScrollableDirections(CGRect rect, ASRangeTuningParameters tuningParameters, ASScrollDirection scrollableDirections, ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN CGRect CGRectExpandToRangeWithScrollableDirections(CGRect rect, ASRangeTuningParameters tuningParameters, ASScrollDirection scrollableDirections, ASScrollDirection scrollDirection);
|
||||
|
||||
@interface ASAbstractLayoutController : NSObject <ASLayoutController>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView *collectionView);
|
||||
ASDK_EXTERN ASSizeRange NodeConstrainedSizeForScrollDirection(ASCollectionView *collectionView);
|
||||
|
||||
@protocol ASCollectionViewLayoutInspecting <NSObject>
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NSUInteger ASDataControllerAnimationOptions;
|
||||
|
||||
AS_EXTERN NSString * const ASDataControllerRowNodeKind;
|
||||
AS_EXTERN NSString * const ASCollectionInvalidUpdateException;
|
||||
ASDK_EXTERN NSString * const ASDataControllerRowNodeKind;
|
||||
ASDK_EXTERN NSString * const ASCollectionInvalidUpdateException;
|
||||
|
||||
/**
|
||||
Data source for data controller
|
||||
|
||||
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @return The rendered image. You can also render intermediary images using UIGraphicsGetImageFromCurrentImageContext.
|
||||
*/
|
||||
AS_EXTERN UIImage *ASGraphicsCreateImageWithOptions(CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, asdisplaynode_iscancelled_block_t NS_NOESCAPE _Nullable isCancelled, void (NS_NOESCAPE ^work)(void)) ASDISPLAYNODE_DEPRECATED_MSG("Use ASGraphicsCreateImageWithTraitCollectionAndOptions instead");
|
||||
ASDK_EXTERN UIImage *ASGraphicsCreateImageWithOptions(CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, asdisplaynode_iscancelled_block_t NS_NOESCAPE _Nullable isCancelled, void (NS_NOESCAPE ^work)(void)) ASDISPLAYNODE_DEPRECATED_MSG("Use ASGraphicsCreateImageWithTraitCollectionAndOptions instead");
|
||||
|
||||
/**
|
||||
* A wrapper for the UIKit drawing APIs. If you are in ASExperimentalDrawingGlobal, and you have iOS >= 10, we will create
|
||||
@@ -45,7 +45,7 @@ AS_EXTERN UIImage *ASGraphicsCreateImageWithOptions(CGSize size, BOOL opaque, CG
|
||||
*
|
||||
* @return The rendered image. You can also render intermediary images using UIGraphicsGetImageFromCurrentImageContext.
|
||||
*/
|
||||
AS_EXTERN UIImage *ASGraphicsCreateImage(ASPrimitiveTraitCollection traitCollection, CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, asdisplaynode_iscancelled_block_t _Nullable NS_NOESCAPE isCancelled, void (NS_NOESCAPE ^work)(void));
|
||||
ASDK_EXTERN UIImage *ASGraphicsCreateImage(ASPrimitiveTraitCollection traitCollection, CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, asdisplaynode_iscancelled_block_t _Nullable NS_NOESCAPE isCancelled, void (NS_NOESCAPE ^work)(void));
|
||||
|
||||
/**
|
||||
* A wrapper for the UIKit drawing APIs.
|
||||
@@ -60,6 +60,6 @@ AS_EXTERN UIImage *ASGraphicsCreateImage(ASPrimitiveTraitCollection traitCollect
|
||||
*
|
||||
* @return The rendered image. You can also render intermediary images using UIGraphicsGetImageFromCurrentImageContext.
|
||||
*/
|
||||
AS_EXTERN UIImage *ASGraphicsCreateImageWithTraitCollectionAndOptions(ASPrimitiveTraitCollection traitCollection, CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, void (NS_NOESCAPE ^work)(void)) ASDISPLAYNODE_DEPRECATED_MSG("Use ASGraphicsCreateImage instead");
|
||||
ASDK_EXTERN UIImage *ASGraphicsCreateImageWithTraitCollectionAndOptions(ASPrimitiveTraitCollection traitCollection, CGSize size, BOOL opaque, CGFloat scale, UIImage * _Nullable sourceImage, void (NS_NOESCAPE ^work)(void)) ASDISPLAYNODE_DEPRECATED_MSG("Use ASGraphicsCreateImage instead");
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -35,6 +35,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* use `pragma clang diagnostic warning "-Wpadded"` around your struct definition
|
||||
* or manually initialize the fields of your struct (`myStruct.x = 7;` etc).
|
||||
*/
|
||||
AS_EXTERN NSUInteger ASHashBytes(void *bytes, size_t length);
|
||||
ASDK_EXTERN NSUInteger ASHashBytes(void *bytes, size_t length);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -15,9 +15,9 @@ typedef struct {
|
||||
CGFloat trailingBufferScreenfuls;
|
||||
} ASRangeTuningParameters;
|
||||
|
||||
AS_EXTERN ASRangeTuningParameters const ASRangeTuningParametersZero;
|
||||
ASDK_EXTERN ASRangeTuningParameters const ASRangeTuningParametersZero;
|
||||
|
||||
AS_EXTERN BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningParameters lhs, ASRangeTuningParameters rhs);
|
||||
ASDK_EXTERN BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningParameters lhs, ASRangeTuningParameters rhs);
|
||||
|
||||
/**
|
||||
* Each mode has a complete set of tuning parameters for range types.
|
||||
|
||||
@@ -44,13 +44,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (NSMutableArray<NSDictionary *> *)propertiesForDescription;
|
||||
@end
|
||||
|
||||
AS_EXTERN NSString *ASGetDescriptionValueString(id object);
|
||||
ASDK_EXTERN NSString *ASGetDescriptionValueString(id object);
|
||||
|
||||
/// Useful for structs etc. Returns e.g. { position = (0 0); frame = (0 0; 50 50) }
|
||||
AS_EXTERN NSString *ASObjectDescriptionMakeWithoutObject(NSArray<NSDictionary *> * _Nullable propertyGroups);
|
||||
ASDK_EXTERN NSString *ASObjectDescriptionMakeWithoutObject(NSArray<NSDictionary *> * _Nullable propertyGroups);
|
||||
|
||||
/// Returns e.g. <MYObject: 0xFFFFFFFF; name = "Object Name"; frame = (0 0; 50 50)>
|
||||
AS_EXTERN NSString *ASObjectDescriptionMake(__autoreleasing id object, NSArray<NSDictionary *> * _Nullable propertyGroups);
|
||||
ASDK_EXTERN NSString *ASObjectDescriptionMake(__autoreleasing id object, NSArray<NSDictionary *> * _Nullable propertyGroups);
|
||||
|
||||
/**
|
||||
* Returns e.g. <MYObject: 0xFFFFFFFF>
|
||||
@@ -58,8 +58,8 @@ AS_EXTERN NSString *ASObjectDescriptionMake(__autoreleasing id object, NSArray<N
|
||||
* Note: `object` param is autoreleasing so that this function is dealloc-safe.
|
||||
* No, unsafe_unretained isn't acceptable here – the optimizer may deallocate object early.
|
||||
*/
|
||||
AS_EXTERN NSString *ASObjectDescriptionMakeTiny(__autoreleasing id _Nullable object);
|
||||
ASDK_EXTERN NSString *ASObjectDescriptionMakeTiny(__autoreleasing id _Nullable object);
|
||||
|
||||
AS_EXTERN NSString * _Nullable ASStringWithQuotesIfMultiword(NSString * _Nullable string);
|
||||
ASDK_EXTERN NSString * _Nullable ASStringWithQuotesIfMultiword(NSString * _Nullable string);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef uintptr_t ASPageCoordinate;
|
||||
/**
|
||||
* Returns a page coordinate with the given x and y values. Both of them must be less than 65,535.
|
||||
*/
|
||||
AS_EXTERN ASPageCoordinate ASPageCoordinateMake(uint16_t x, uint16_t y) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASPageCoordinate ASPageCoordinateMake(uint16_t x, uint16_t y) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Returns coordinate of the page that contains the specified point.
|
||||
@@ -33,13 +33,13 @@ AS_EXTERN ASPageCoordinate ASPageCoordinateMake(uint16_t x, uint16_t y) AS_WARN_
|
||||
*
|
||||
* @param pageSize The size of each page.
|
||||
*/
|
||||
AS_EXTERN ASPageCoordinate ASPageCoordinateForPageThatContainsPoint(CGPoint point, CGSize pageSize) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASPageCoordinate ASPageCoordinateForPageThatContainsPoint(CGPoint point, CGSize pageSize) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
AS_EXTERN uint16_t ASPageCoordinateGetX(ASPageCoordinate pageCoordinate) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN uint16_t ASPageCoordinateGetX(ASPageCoordinate pageCoordinate) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
AS_EXTERN uint16_t ASPageCoordinateGetY(ASPageCoordinate pageCoordinate) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN uint16_t ASPageCoordinateGetY(ASPageCoordinate pageCoordinate) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
AS_EXTERN CGRect ASPageCoordinateGetPageRect(ASPageCoordinate pageCoordinate, CGSize pageSize) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN CGRect ASPageCoordinateGetPageRect(ASPageCoordinate pageCoordinate, CGSize pageSize) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Returns coordinate pointers for pages that intersect the specified rect. For each pointer, use ASPageCoordinateFromPointer() to get the original coordinate.
|
||||
@@ -51,7 +51,7 @@ AS_EXTERN CGRect ASPageCoordinateGetPageRect(ASPageCoordinate pageCoordinate, CG
|
||||
*
|
||||
* @param pageSize The size of each page.
|
||||
*/
|
||||
AS_EXTERN NSPointerArray * _Nullable ASPageCoordinatesForPagesThatIntersectRect(CGRect rect, CGSize contentSize, CGSize pageSize) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSPointerArray * _Nullable ASPageCoordinatesForPagesThatIntersectRect(CGRect rect, CGSize contentSize, CGSize pageSize) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* An alias for an NSMapTable created to store objects using ASPageCoordinates as keys.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN NSString *const ASPhotosURLScheme;
|
||||
ASDK_EXTERN NSString *const ASPhotosURLScheme;
|
||||
|
||||
/**
|
||||
@abstract Use ASPhotosFrameworkImageRequest to encapsulate all the information needed to request an image from
|
||||
|
||||
@@ -27,13 +27,13 @@ typedef struct {
|
||||
/**
|
||||
* Lock, blocking if needed.
|
||||
*/
|
||||
AS_EXTERN OS_UNFAIR_LOCK_AVAILABILITY
|
||||
ASDK_EXTERN OS_UNFAIR_LOCK_AVAILABILITY
|
||||
void ASRecursiveUnfairLockLock(ASRecursiveUnfairLock *l);
|
||||
|
||||
/**
|
||||
* Try to lock without blocking. Returns whether we took the lock.
|
||||
*/
|
||||
AS_EXTERN OS_UNFAIR_LOCK_AVAILABILITY
|
||||
ASDK_EXTERN OS_UNFAIR_LOCK_AVAILABILITY
|
||||
BOOL ASRecursiveUnfairLockTryLock(ASRecursiveUnfairLock *l);
|
||||
|
||||
/**
|
||||
@@ -41,7 +41,7 @@ BOOL ASRecursiveUnfairLockTryLock(ASRecursiveUnfairLock *l);
|
||||
* the lock will result in an assertion failure, and undefined
|
||||
* behavior if foundation assertions are disabled.
|
||||
*/
|
||||
AS_EXTERN OS_UNFAIR_LOCK_AVAILABILITY
|
||||
ASDK_EXTERN OS_UNFAIR_LOCK_AVAILABILITY
|
||||
void ASRecursiveUnfairLockUnlock(ASRecursiveUnfairLock *l);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -22,16 +22,16 @@ typedef NS_OPTIONS(unsigned char, ASScrollDirection) {
|
||||
ASScrollDirectionDown = 1 << 3
|
||||
};
|
||||
|
||||
AS_EXTERN const ASScrollDirection ASScrollDirectionHorizontalDirections;
|
||||
AS_EXTERN const ASScrollDirection ASScrollDirectionVerticalDirections;
|
||||
ASDK_EXTERN const ASScrollDirection ASScrollDirectionHorizontalDirections;
|
||||
ASDK_EXTERN const ASScrollDirection ASScrollDirectionVerticalDirections;
|
||||
|
||||
AS_EXTERN BOOL ASScrollDirectionContainsVerticalDirection(ASScrollDirection scrollDirection);
|
||||
AS_EXTERN BOOL ASScrollDirectionContainsHorizontalDirection(ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN BOOL ASScrollDirectionContainsVerticalDirection(ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN BOOL ASScrollDirectionContainsHorizontalDirection(ASScrollDirection scrollDirection);
|
||||
|
||||
AS_EXTERN BOOL ASScrollDirectionContainsRight(ASScrollDirection scrollDirection);
|
||||
AS_EXTERN BOOL ASScrollDirectionContainsLeft(ASScrollDirection scrollDirection);
|
||||
AS_EXTERN BOOL ASScrollDirectionContainsUp(ASScrollDirection scrollDirection);
|
||||
AS_EXTERN BOOL ASScrollDirectionContainsDown(ASScrollDirection scrollDirection);
|
||||
AS_EXTERN ASScrollDirection ASScrollDirectionApplyTransform(ASScrollDirection scrollDirection, CGAffineTransform transform);
|
||||
ASDK_EXTERN BOOL ASScrollDirectionContainsRight(ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN BOOL ASScrollDirectionContainsLeft(ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN BOOL ASScrollDirectionContainsUp(ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN BOOL ASScrollDirectionContainsDown(ASScrollDirection scrollDirection);
|
||||
ASDK_EXTERN ASScrollDirection ASScrollDirectionApplyTransform(ASScrollDirection scrollDirection, CGAffineTransform transform);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -59,34 +59,34 @@ typedef struct {
|
||||
/**
|
||||
* Creates ASPrimitiveTraitCollection with default values.
|
||||
*/
|
||||
AS_EXTERN ASPrimitiveTraitCollection ASPrimitiveTraitCollectionMakeDefault(void);
|
||||
ASDK_EXTERN ASPrimitiveTraitCollection ASPrimitiveTraitCollectionMakeDefault(void);
|
||||
|
||||
/**
|
||||
* Creates a ASPrimitiveTraitCollection from a given UITraitCollection.
|
||||
*/
|
||||
AS_EXTERN ASPrimitiveTraitCollection ASPrimitiveTraitCollectionFromUITraitCollection(UITraitCollection *traitCollection);
|
||||
ASDK_EXTERN ASPrimitiveTraitCollection ASPrimitiveTraitCollectionFromUITraitCollection(UITraitCollection *traitCollection);
|
||||
|
||||
/**
|
||||
* Creates a UITraitCollection from a given ASPrimitiveTraitCollection.
|
||||
*/
|
||||
AS_EXTERN UITraitCollection * ASPrimitiveTraitCollectionToUITraitCollection(ASPrimitiveTraitCollection traitCollection);
|
||||
ASDK_EXTERN UITraitCollection * ASPrimitiveTraitCollectionToUITraitCollection(ASPrimitiveTraitCollection traitCollection);
|
||||
|
||||
|
||||
/**
|
||||
* Compares two ASPrimitiveTraitCollection to determine if they are the same.
|
||||
*/
|
||||
AS_EXTERN BOOL ASPrimitiveTraitCollectionIsEqualToASPrimitiveTraitCollection(ASPrimitiveTraitCollection lhs, ASPrimitiveTraitCollection rhs);
|
||||
ASDK_EXTERN BOOL ASPrimitiveTraitCollectionIsEqualToASPrimitiveTraitCollection(ASPrimitiveTraitCollection lhs, ASPrimitiveTraitCollection rhs);
|
||||
|
||||
/**
|
||||
* Returns a string representation of a ASPrimitiveTraitCollection.
|
||||
*/
|
||||
AS_EXTERN NSString *NSStringFromASPrimitiveTraitCollection(ASPrimitiveTraitCollection traits);
|
||||
ASDK_EXTERN NSString *NSStringFromASPrimitiveTraitCollection(ASPrimitiveTraitCollection traits);
|
||||
|
||||
/**
|
||||
* This function will walk the layout element hierarchy and updates the layout element trait collection for every
|
||||
* layout element within the hierarchy.
|
||||
*/
|
||||
AS_EXTERN void ASTraitCollectionPropagateDown(id<ASLayoutElement> element, ASPrimitiveTraitCollection traitCollection);
|
||||
ASDK_EXTERN void ASTraitCollectionPropagateDown(id<ASLayoutElement> element, ASPrimitiveTraitCollection traitCollection);
|
||||
|
||||
/**
|
||||
* Abstraction on top of UITraitCollection for propagation within AsyncDisplayKit-Layout
|
||||
@@ -105,7 +105,7 @@ AS_EXTERN void ASTraitCollectionPropagateDown(id<ASLayoutElement> element, ASPri
|
||||
* @abstract Sets a trait collection on this environment state.
|
||||
*
|
||||
* @discussion This only exists as an internal convenience method. Users should not override trait collection using it.
|
||||
* Use [ASViewController overrideDisplayTraitsWithTraitCollection] block instead.
|
||||
* Use [ASDKViewController overrideDisplayTraitsWithTraitCollection] block instead.
|
||||
*/
|
||||
- (void)setPrimitiveTraitCollection:(ASPrimitiveTraitCollection)traitCollection;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ ASPrimitiveTraitCollection ASPrimitiveTraitCollectionFromUITraitCollection(UITra
|
||||
return environmentTraitCollection;
|
||||
}
|
||||
|
||||
AS_EXTERN UITraitCollection * ASPrimitiveTraitCollectionToUITraitCollection(ASPrimitiveTraitCollection traitCollection) {
|
||||
ASDK_EXTERN UITraitCollection * ASPrimitiveTraitCollectionToUITraitCollection(ASPrimitiveTraitCollection traitCollection) {
|
||||
NSMutableArray *collections = [[NSMutableArray alloc] initWithArray:@[
|
||||
[UITraitCollection traitCollectionWithHorizontalSizeClass:traitCollection.horizontalSizeClass],
|
||||
[UITraitCollection traitCollectionWithVerticalSizeClass:traitCollection.verticalSizeClass],
|
||||
|
||||
@@ -32,7 +32,7 @@ typedef NS_ENUM(NSUInteger, ASAsyncTransactionState) {
|
||||
ASAsyncTransactionStateComplete
|
||||
};
|
||||
|
||||
AS_EXTERN NSInteger const ASDefaultTransactionPriority;
|
||||
ASDK_EXTERN NSInteger const ASDefaultTransactionPriority;
|
||||
|
||||
/**
|
||||
@summary ASAsyncTransaction provides lightweight transaction semantics for asynchronous operations.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#warning "Texture must be compiled with std=c++11 to prevent layout issues. gnu++ is not supported. This is hopefully temporary."
|
||||
#endif
|
||||
|
||||
AS_EXTERN NSRunLoopMode const UITrackingRunLoopMode;
|
||||
ASDK_EXTERN NSRunLoopMode const UITrackingRunLoopMode;
|
||||
|
||||
NSInteger const ASDefaultTransactionPriority = 0;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Convenience.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||
#import <AsyncDisplayKit/ASLayout.h>
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
|
||||
#pragma mark - _ASDisplayView
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
if (superview && node.viewControllerRoot) {
|
||||
UIViewController *vc = [node closestViewController];
|
||||
|
||||
ASDisplayNodeAssert(vc != nil && [vc isKindOfClass:[ASViewController class]] && ((ASViewController*)vc).node == node, @"This node was once used as a view controller's node. You should not reuse it without its view controller.");
|
||||
ASDisplayNodeAssert(vc != nil && [vc isKindOfClass:[ASDKViewController class]] && ((ASDKViewController*)vc).node == node, @"This node was once used as a view controller's node. You should not reuse it without its view controller.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+10
-10
@@ -83,7 +83,7 @@ typedef struct {
|
||||
/**
|
||||
* Represents auto as ASDimension
|
||||
*/
|
||||
AS_EXTERN ASDimension const ASDimensionAuto;
|
||||
ASDK_EXTERN ASDimension const ASDimensionAuto;
|
||||
|
||||
/**
|
||||
* Returns a dimension with the specified type and value.
|
||||
@@ -116,7 +116,7 @@ ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensio
|
||||
* Examples: ASDimensionMake(@"50%") = ASDimensionMake(ASDimensionUnitFraction, 0.5)
|
||||
* ASDimensionMake(@"0.5pt") = ASDimensionMake(ASDimensionUnitPoints, 0.5)
|
||||
*/
|
||||
ASOVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN ASDimension ASDimensionMake(NSString *dimension);
|
||||
ASOVERLOADABLE AS_WARN_UNUSED_RESULT ASDK_EXTERN ASDimension ASDimensionMake(NSString *dimension);
|
||||
|
||||
/**
|
||||
* Returns a dimension with the specified points value.
|
||||
@@ -147,7 +147,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASDimensionEqualToDimension(ASDi
|
||||
/**
|
||||
* Returns a NSString representation of a dimension.
|
||||
*/
|
||||
AS_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASDimension(ASDimension dimension);
|
||||
ASDK_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASDimension(ASDimension dimension);
|
||||
|
||||
/**
|
||||
* Resolve this dimension to a parent size.
|
||||
@@ -174,7 +174,7 @@ typedef struct {
|
||||
ASDimension height;
|
||||
} ASLayoutSize;
|
||||
|
||||
AS_EXTERN ASLayoutSize const ASLayoutSizeAuto;
|
||||
ASDK_EXTERN ASLayoutSize const ASLayoutSizeAuto;
|
||||
|
||||
/*
|
||||
* Creates an ASLayoutSize with provided min and max dimensions.
|
||||
@@ -219,12 +219,12 @@ typedef struct {
|
||||
/**
|
||||
* A size range with all dimensions zero.
|
||||
*/
|
||||
AS_EXTERN ASSizeRange const ASSizeRangeZero;
|
||||
ASDK_EXTERN ASSizeRange const ASSizeRangeZero;
|
||||
|
||||
/**
|
||||
* A size range from zero to infinity in both directions.
|
||||
*/
|
||||
AS_EXTERN ASSizeRange const ASSizeRangeUnconstrained;
|
||||
ASDK_EXTERN ASSizeRange const ASSizeRangeUnconstrained;
|
||||
|
||||
/**
|
||||
* Returns whether a size range has > 0.1 max width and max height.
|
||||
@@ -275,7 +275,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT CGSize ASSizeRangeClamp(ASSizeRange s
|
||||
* Intersects another size range. If the other size range does not overlap in either dimension, this size range
|
||||
* "wins" by returning a single point within its own range that is closest to the non-overlapping range.
|
||||
*/
|
||||
AS_EXTERN AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeIntersect(ASSizeRange sizeRange, ASSizeRange otherSizeRange);
|
||||
ASDK_EXTERN AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeIntersect(ASSizeRange sizeRange, ASSizeRange otherSizeRange);
|
||||
|
||||
/**
|
||||
* Returns whether two size ranges are equal in min and max size.
|
||||
@@ -288,7 +288,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASSizeRangeEqualToSizeRange(ASSi
|
||||
/**
|
||||
* Returns a string representation of a size range
|
||||
*/
|
||||
AS_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASSizeRange(ASSizeRange sizeRange);
|
||||
ASDK_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASSizeRange(ASSizeRange sizeRange);
|
||||
|
||||
#if YOGA
|
||||
|
||||
@@ -306,9 +306,9 @@ typedef struct {
|
||||
ASDimension all;
|
||||
} ASEdgeInsets;
|
||||
|
||||
AS_EXTERN ASEdgeInsets const ASEdgeInsetsZero;
|
||||
ASDK_EXTERN ASEdgeInsets const ASEdgeInsetsZero;
|
||||
|
||||
AS_EXTERN ASEdgeInsets ASEdgeInsetsMake(UIEdgeInsets edgeInsets);
|
||||
ASDK_EXTERN ASEdgeInsets ASEdgeInsetsMake(UIEdgeInsets edgeInsets);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutElementSizeEqualToLayout
|
||||
/**
|
||||
* Returns a string formatted to contain the data from an ASLayoutElementSize.
|
||||
*/
|
||||
AS_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASLayoutElementSize(ASLayoutElementSize size);
|
||||
ASDK_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASLayoutElementSize(ASLayoutElementSize size);
|
||||
|
||||
/**
|
||||
* Resolve the given size relative to a parent size and an auto size.
|
||||
@@ -86,7 +86,7 @@ AS_EXTERN AS_WARN_UNUSED_RESULT NSString *NSStringFromASLayoutElementSize(ASLayo
|
||||
* dimension with unit ASDimensionUnitAuto the given autoASSizeRange value will be used.
|
||||
* Based on the calculated exact, min and max size constraints the final size range will be calculated.
|
||||
*/
|
||||
AS_EXTERN AS_WARN_UNUSED_RESULT ASSizeRange ASLayoutElementSizeResolveAutoSize(ASLayoutElementSize size, const CGSize parentSize, ASSizeRange autoASSizeRange);
|
||||
ASDK_EXTERN AS_WARN_UNUSED_RESULT ASSizeRange ASLayoutElementSizeResolveAutoSize(ASLayoutElementSize size, const CGSize parentSize, ASSizeRange autoASSizeRange);
|
||||
|
||||
/**
|
||||
* Resolve the given size to a parent size. Uses internally ASLayoutElementSizeResolveAutoSize with {INFINITY, INFINITY} as
|
||||
|
||||
@@ -14,18 +14,18 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN CGPoint const ASPointNull; // {NAN, NAN}
|
||||
ASDK_EXTERN CGPoint const ASPointNull; // {NAN, NAN}
|
||||
|
||||
AS_EXTERN BOOL ASPointIsNull(CGPoint point);
|
||||
ASDK_EXTERN BOOL ASPointIsNull(CGPoint point);
|
||||
|
||||
AS_EXTERN NSString *const ASThreadDictMaxConstraintSizeKey;
|
||||
ASDK_EXTERN NSString *const ASThreadDictMaxConstraintSizeKey;
|
||||
|
||||
/**
|
||||
* Safely calculates the layout of the given root layoutElement by guarding against nil nodes.
|
||||
* @param rootLayoutElement The root node to calculate the layout for.
|
||||
* @param sizeRange The size range to calculate the root layout within.
|
||||
*/
|
||||
AS_EXTERN ASLayout *ASCalculateRootLayout(id<ASLayoutElement> rootLayoutElement, const ASSizeRange sizeRange);
|
||||
ASDK_EXTERN ASLayout *ASCalculateRootLayout(id<ASLayoutElement> rootLayoutElement, const ASSizeRange sizeRange);
|
||||
|
||||
/**
|
||||
* Safely computes the layout of the given node by guarding against nil nodes.
|
||||
@@ -33,7 +33,7 @@ AS_EXTERN ASLayout *ASCalculateRootLayout(id<ASLayoutElement> rootLayoutElement,
|
||||
* @param sizeRange The size range to calculate the node layout within.
|
||||
* @param parentSize The parent size of the node to calculate the layout for.
|
||||
*/
|
||||
AS_EXTERN ASLayout *ASCalculateLayout(id<ASLayoutElement>layoutElement, const ASSizeRange sizeRange, const CGSize parentSize);
|
||||
ASDK_EXTERN ASLayout *ASCalculateLayout(id<ASLayoutElement>layoutElement, const ASSizeRange sizeRange, const CGSize parentSize);
|
||||
|
||||
/**
|
||||
* A node in the layout tree that represents the size and position of the object that created it (ASLayoutElement).
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** A constant that indicates that the parent's size is not yet determined in a given dimension. */
|
||||
AS_EXTERN CGFloat const ASLayoutElementParentDimensionUndefined;
|
||||
ASDK_EXTERN CGFloat const ASLayoutElementParentDimensionUndefined;
|
||||
|
||||
/** A constant that indicates that the parent's size is not yet determined in either dimension. */
|
||||
AS_EXTERN CGSize const ASLayoutElementParentSizeUndefined;
|
||||
ASDK_EXTERN CGSize const ASLayoutElementParentSizeUndefined;
|
||||
|
||||
/** Type of ASLayoutElement */
|
||||
typedef NS_ENUM(unsigned char, ASLayoutElementType) {
|
||||
@@ -144,24 +144,24 @@ typedef NS_ENUM(unsigned char, ASLayoutElementType) {
|
||||
|
||||
#pragma mark - ASLayoutElementStyle
|
||||
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleWidthProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleMinWidthProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleMaxWidthProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleWidthProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleMinWidthProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleMaxWidthProperty;
|
||||
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleHeightProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleMinHeightProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleMaxHeightProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleHeightProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleMinHeightProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleMaxHeightProperty;
|
||||
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleSpacingBeforeProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleSpacingAfterProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleFlexGrowProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleFlexShrinkProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleFlexBasisProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleAlignSelfProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleAscenderProperty;
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleDescenderProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleSpacingBeforeProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleSpacingAfterProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleFlexGrowProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleFlexShrinkProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleFlexBasisProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleAlignSelfProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleAscenderProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleDescenderProperty;
|
||||
|
||||
AS_EXTERN NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
ASDK_EXTERN NSString * const ASLayoutElementStyleLayoutPositionProperty;
|
||||
|
||||
@protocol ASLayoutElementStyleDelegate <NSObject>
|
||||
- (void)style:(__kindof ASLayoutElementStyle *)style propertyDidChange:(NSString *)propertyName;
|
||||
|
||||
@@ -22,16 +22,16 @@ AS_SUBCLASSING_RESTRICTED
|
||||
@property (nonatomic) int32_t transitionID;
|
||||
@end
|
||||
|
||||
AS_EXTERN int32_t const ASLayoutElementContextInvalidTransitionID;
|
||||
ASDK_EXTERN int32_t const ASLayoutElementContextInvalidTransitionID;
|
||||
|
||||
AS_EXTERN int32_t const ASLayoutElementContextDefaultTransitionID;
|
||||
ASDK_EXTERN int32_t const ASLayoutElementContextDefaultTransitionID;
|
||||
|
||||
// Does not currently support nesting – there must be no current context.
|
||||
AS_EXTERN void ASLayoutElementPushContext(ASLayoutElementContext * context);
|
||||
ASDK_EXTERN void ASLayoutElementPushContext(ASLayoutElementContext * context);
|
||||
|
||||
AS_EXTERN ASLayoutElementContext * _Nullable ASLayoutElementGetCurrentContext(void);
|
||||
ASDK_EXTERN ASLayoutElementContext * _Nullable ASLayoutElementGetCurrentContext(void);
|
||||
|
||||
AS_EXTERN void ASLayoutElementPopContext(void);
|
||||
ASDK_EXTERN void ASLayoutElementPopContext(void);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
@@ -27,22 +27,22 @@
|
||||
@end
|
||||
|
||||
// pre-order, depth-first
|
||||
AS_EXTERN void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode *node, void(^block)(ASDisplayNode *node));
|
||||
ASDK_EXTERN void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode *node, void(^block)(ASDisplayNode *node));
|
||||
|
||||
#pragma mark - Yoga Type Conversion Helpers
|
||||
|
||||
AS_EXTERN YGAlign yogaAlignItems(ASStackLayoutAlignItems alignItems);
|
||||
AS_EXTERN YGJustify yogaJustifyContent(ASStackLayoutJustifyContent justifyContent);
|
||||
AS_EXTERN YGAlign yogaAlignSelf(ASStackLayoutAlignSelf alignSelf);
|
||||
AS_EXTERN YGFlexDirection yogaFlexDirection(ASStackLayoutDirection direction);
|
||||
AS_EXTERN float yogaFloatForCGFloat(CGFloat value);
|
||||
AS_EXTERN float yogaDimensionToPoints(ASDimension dimension);
|
||||
AS_EXTERN float yogaDimensionToPercent(ASDimension dimension);
|
||||
AS_EXTERN ASDimension dimensionForEdgeWithEdgeInsets(YGEdge edge, ASEdgeInsets insets);
|
||||
ASDK_EXTERN YGAlign yogaAlignItems(ASStackLayoutAlignItems alignItems);
|
||||
ASDK_EXTERN YGJustify yogaJustifyContent(ASStackLayoutJustifyContent justifyContent);
|
||||
ASDK_EXTERN YGAlign yogaAlignSelf(ASStackLayoutAlignSelf alignSelf);
|
||||
ASDK_EXTERN YGFlexDirection yogaFlexDirection(ASStackLayoutDirection direction);
|
||||
ASDK_EXTERN float yogaFloatForCGFloat(CGFloat value);
|
||||
ASDK_EXTERN float yogaDimensionToPoints(ASDimension dimension);
|
||||
ASDK_EXTERN float yogaDimensionToPercent(ASDimension dimension);
|
||||
ASDK_EXTERN ASDimension dimensionForEdgeWithEdgeInsets(YGEdge edge, ASEdgeInsets insets);
|
||||
|
||||
AS_EXTERN void ASLayoutElementYogaUpdateMeasureFunc(YGNodeRef yogaNode, id <ASLayoutElement> layoutElement);
|
||||
AS_EXTERN float ASLayoutElementYogaBaselineFunc(YGNodeRef yogaNode, const float width, const float height);
|
||||
AS_EXTERN YGSize ASLayoutElementYogaMeasureFunc(YGNodeRef yogaNode,
|
||||
ASDK_EXTERN void ASLayoutElementYogaUpdateMeasureFunc(YGNodeRef yogaNode, id <ASLayoutElement> layoutElement);
|
||||
ASDK_EXTERN float ASLayoutElementYogaBaselineFunc(YGNodeRef yogaNode, const float width, const float height);
|
||||
ASDK_EXTERN YGSize ASLayoutElementYogaMeasureFunc(YGNodeRef yogaNode,
|
||||
float width, YGMeasureMode widthMode,
|
||||
float height, YGMeasureMode heightMode);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@param velocity The velocity of the scroll view (in points) at the moment the touch was released.
|
||||
@return Whether or not the current state should proceed with batch fetching.
|
||||
*/
|
||||
AS_EXTERN BOOL ASDisplayShouldFetchBatchForScrollView(UIScrollView<ASBatchFetchingScrollView> *scrollView,
|
||||
ASDK_EXTERN BOOL ASDisplayShouldFetchBatchForScrollView(UIScrollView<ASBatchFetchingScrollView> *scrollView,
|
||||
ASScrollDirection scrollDirection,
|
||||
ASScrollDirection scrollableDirections,
|
||||
CGPoint contentOffset,
|
||||
@@ -59,7 +59,7 @@ AS_EXTERN BOOL ASDisplayShouldFetchBatchForScrollView(UIScrollView<ASBatchFetchi
|
||||
@discussion This method is broken into a category for unit testing purposes and should be used with the ASTableView and
|
||||
* ASCollectionView batch fetching API.
|
||||
*/
|
||||
AS_EXTERN BOOL ASDisplayShouldFetchBatchForContext(ASBatchContext *context,
|
||||
ASDK_EXTERN BOOL ASDisplayShouldFetchBatchForContext(ASBatchContext *context,
|
||||
ASScrollDirection scrollDirection,
|
||||
ASScrollDirection scrollableDirections,
|
||||
CGRect bounds,
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN ASSizeRange ASSizeRangeForCollectionLayoutThatFitsViewportSize(CGSize viewportSize, ASScrollDirection scrollableDirections) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN ASSizeRange ASSizeRangeForCollectionLayoutThatFitsViewportSize(CGSize viewportSize, ASScrollDirection scrollableDirections) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* Note: The actual number of threads may be lower than threadCount, if libdispatch
|
||||
* decides the system can't handle it. In reality this rarely happens.
|
||||
*/
|
||||
AS_EXTERN void ASDispatchApply(size_t iterationCount, dispatch_queue_t queue, NSUInteger threadCount, NS_NOESCAPE void(^work)(size_t i));
|
||||
ASDK_EXTERN void ASDispatchApply(size_t iterationCount, dispatch_queue_t queue, NSUInteger threadCount, NS_NOESCAPE void(^work)(size_t i));
|
||||
|
||||
/**
|
||||
* Like dispatch_async, but you can set the thread count. 0 means 2*active CPUs.
|
||||
@@ -24,4 +24,4 @@ AS_EXTERN void ASDispatchApply(size_t iterationCount, dispatch_queue_t queue, NS
|
||||
* Note: The actual number of threads may be lower than threadCount, if libdispatch
|
||||
* decides the system can't handle it. In reality this rarely happens.
|
||||
*/
|
||||
AS_EXTERN void ASDispatchAsync(size_t iterationCount, dispatch_queue_t queue, NSUInteger threadCount, NS_NOESCAPE void(^work)(size_t i));
|
||||
ASDK_EXTERN void ASDispatchAsync(size_t iterationCount, dispatch_queue_t queue, NSUInteger threadCount, NS_NOESCAPE void(^work)(size_t i));
|
||||
|
||||
@@ -174,7 +174,7 @@ __unused static NSString * _Nonnull NSStringFromASHierarchyStateChange(ASHierarc
|
||||
* @abstract Ensure that all rendering is complete for this node and its descendants.
|
||||
*
|
||||
* @discussion Calling this method on the main thread after a node is added to the view hierarchy will ensure that
|
||||
* placeholder states are never visible to the user. It is used by ASTableView, ASCollectionView, and ASViewController
|
||||
* placeholder states are never visible to the user. It is used by ASTableView, ASCollectionView, and ASDKViewController
|
||||
* to implement their respective ".neverShowPlaceholders" option.
|
||||
*
|
||||
* If all nodes have layer.contents set and/or their layer does not have -needsDisplay set, the method will return immediately.
|
||||
@@ -242,10 +242,10 @@ __unused static NSString * _Nonnull NSStringFromASHierarchyStateChange(ASHierarc
|
||||
/**
|
||||
* @abstract Indicates if this node is a view controller's root node. Defaults to NO.
|
||||
*
|
||||
* @discussion Set to YES in -[ASViewController initWithNode:].
|
||||
* @discussion Set to YES in -[ASDKViewController initWithNode:].
|
||||
*
|
||||
* YES here only means that this node is used as an ASViewController node. It doesn't mean that this node is a root of
|
||||
* ASDisplayNode hierarchy, e.g. when its view controller is parented by another ASViewController.
|
||||
* YES here only means that this node is used as an ASDKViewController node. It doesn't mean that this node is a root of
|
||||
* ASDisplayNode hierarchy, e.g. when its view controller is parented by another ASDKViewController.
|
||||
*/
|
||||
@property (nonatomic, getter=isViewControllerRoot) BOOL viewControllerRoot;
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ typedef NS_OPTIONS(uint_least32_t, ASDisplayNodeAtomicFlags)
|
||||
#define setFlag(flag, x) (((x ? _atomicFlags.fetch_or(flag) \
|
||||
: _atomicFlags.fetch_and(~flag)) & flag) != 0)
|
||||
|
||||
AS_EXTERN NSString * const ASRenderingEngineDidDisplayScheduledNodesNotification;
|
||||
AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp;
|
||||
ASDK_EXTERN NSString * const ASRenderingEngineDidDisplayScheduledNodesNotification;
|
||||
ASDK_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp;
|
||||
|
||||
// Allow 2^n increments of begin disabling hierarchy notifications
|
||||
#define VISIBILITY_NOTIFICATIONS_DISABLED_BITS 4
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
@param forcedSize A CGSize, that if non-CGSizeZero, indicates that the backing size should be forcedSize and not calculated based on boundsSize.
|
||||
@discussion If the image is smaller than the size and UIViewContentModeScaleToAspectFill is specified, we suggest the input size so it will be efficiently upscaled on the GPU by the displaying layer at composite time.
|
||||
*/
|
||||
AS_EXTERN void ASCroppedImageBackingSizeAndDrawRectInBounds(CGSize sourceImageSize,
|
||||
ASDK_EXTERN void ASCroppedImageBackingSizeAndDrawRectInBounds(CGSize sourceImageSize,
|
||||
CGSize boundsSize,
|
||||
UIViewContentMode contentMode,
|
||||
CGRect cropRect,
|
||||
|
||||
@@ -17,41 +17,41 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
AS_EXTERN void ASInitializeFrameworkMainThread(void);
|
||||
ASDK_EXTERN void ASInitializeFrameworkMainThread(void);
|
||||
|
||||
AS_EXTERN BOOL ASDefaultAllowsGroupOpacity(void);
|
||||
AS_EXTERN BOOL ASDefaultAllowsEdgeAntialiasing(void);
|
||||
ASDK_EXTERN BOOL ASDefaultAllowsGroupOpacity(void);
|
||||
ASDK_EXTERN BOOL ASDefaultAllowsEdgeAntialiasing(void);
|
||||
|
||||
AS_EXTERN BOOL ASSubclassOverridesSelector(Class superclass, Class subclass, SEL selector);
|
||||
AS_EXTERN BOOL ASSubclassOverridesClassSelector(Class superclass, Class subclass, SEL selector);
|
||||
ASDK_EXTERN BOOL ASSubclassOverridesSelector(Class superclass, Class subclass, SEL selector);
|
||||
ASDK_EXTERN BOOL ASSubclassOverridesClassSelector(Class superclass, Class subclass, SEL selector);
|
||||
|
||||
/// Replace a method from the given class with a block and returns the original method IMP
|
||||
AS_EXTERN IMP ASReplaceMethodWithBlock(Class c, SEL origSEL, id block);
|
||||
ASDK_EXTERN IMP ASReplaceMethodWithBlock(Class c, SEL origSEL, id block);
|
||||
|
||||
/// Dispatches the given block to the main queue if not already running on the main thread
|
||||
AS_EXTERN void ASPerformBlockOnMainThread(void (^block)(void));
|
||||
ASDK_EXTERN void ASPerformBlockOnMainThread(void (^block)(void));
|
||||
|
||||
/// Dispatches the given block to a background queue with priority of DISPATCH_QUEUE_PRIORITY_DEFAULT if not already run on a background queue
|
||||
AS_EXTERN void ASPerformBlockOnBackgroundThread(void (^block)(void)); // DISPATCH_QUEUE_PRIORITY_DEFAULT
|
||||
ASDK_EXTERN void ASPerformBlockOnBackgroundThread(void (^block)(void)); // DISPATCH_QUEUE_PRIORITY_DEFAULT
|
||||
|
||||
/// For deallocation of objects on a background thread without GCD overhead / thread explosion
|
||||
AS_EXTERN void ASPerformBackgroundDeallocation(id __strong _Nullable * _Nonnull object);
|
||||
ASDK_EXTERN void ASPerformBackgroundDeallocation(id __strong _Nullable * _Nonnull object);
|
||||
|
||||
AS_EXTERN CGFloat ASScreenScale(void);
|
||||
ASDK_EXTERN CGFloat ASScreenScale(void);
|
||||
|
||||
AS_EXTERN CGSize ASFloorSizeValues(CGSize s);
|
||||
ASDK_EXTERN CGSize ASFloorSizeValues(CGSize s);
|
||||
|
||||
AS_EXTERN CGFloat ASFloorPixelValue(CGFloat f);
|
||||
ASDK_EXTERN CGFloat ASFloorPixelValue(CGFloat f);
|
||||
|
||||
AS_EXTERN CGPoint ASCeilPointValues(CGPoint p);
|
||||
ASDK_EXTERN CGPoint ASCeilPointValues(CGPoint p);
|
||||
|
||||
AS_EXTERN CGSize ASCeilSizeValues(CGSize s);
|
||||
ASDK_EXTERN CGSize ASCeilSizeValues(CGSize s);
|
||||
|
||||
AS_EXTERN CGFloat ASCeilPixelValue(CGFloat f);
|
||||
ASDK_EXTERN CGFloat ASCeilPixelValue(CGFloat f);
|
||||
|
||||
AS_EXTERN CGFloat ASRoundPixelValue(CGFloat f);
|
||||
ASDK_EXTERN CGFloat ASRoundPixelValue(CGFloat f);
|
||||
|
||||
AS_EXTERN Class _Nullable ASGetClassFromType(const char * _Nullable type);
|
||||
ASDK_EXTERN Class _Nullable ASGetClassFromType(const char * _Nullable type);
|
||||
|
||||
ASDISPLAYNODE_INLINE BOOL ASImageAlphaInfoIsOpaque(CGImageAlphaInfo info) {
|
||||
switch (info) {
|
||||
@@ -120,7 +120,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASImageDownloaderPriority ASImageDown
|
||||
/**
|
||||
* Create an NSMutableSet that uses pointers for hash & equality.
|
||||
*/
|
||||
AS_EXTERN NSMutableSet *ASCreatePointerBasedMutableSet(void);
|
||||
ASDK_EXTERN NSMutableSet *ASCreatePointerBasedMutableSet(void);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import <AsyncDisplayKit/ASBaseDefines.h>
|
||||
|
||||
#if AS_ENABLE_TIPS
|
||||
|
||||
@@ -21,26 +21,26 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* Deep mutable copy of an array that contains arrays, which contain objects. It will go one level deep into the array to copy.
|
||||
* This method is substantially faster than the generalized version, e.g. about 10x faster, so use it whenever it fits the need.
|
||||
*/
|
||||
AS_EXTERN NSMutableArray<NSMutableArray *> *ASTwoDimensionalArrayDeepMutableCopy(NSArray<NSArray *> *array) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSMutableArray<NSMutableArray *> *ASTwoDimensionalArrayDeepMutableCopy(NSArray<NSArray *> *array) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Delete the elements of the mutable two-dimensional array at given index paths – sorted in descending order!
|
||||
*/
|
||||
AS_EXTERN void ASDeleteElementsInTwoDimensionalArrayAtIndexPaths(NSMutableArray *mutableArray, NSArray<NSIndexPath *> *indexPaths);
|
||||
ASDK_EXTERN void ASDeleteElementsInTwoDimensionalArrayAtIndexPaths(NSMutableArray *mutableArray, NSArray<NSIndexPath *> *indexPaths);
|
||||
|
||||
/**
|
||||
* Return all the index paths of a two-dimensional array, in ascending order.
|
||||
*/
|
||||
AS_EXTERN NSArray<NSIndexPath *> *ASIndexPathsForTwoDimensionalArray(NSArray<NSArray *>* twoDimensionalArray) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSArray<NSIndexPath *> *ASIndexPathsForTwoDimensionalArray(NSArray<NSArray *>* twoDimensionalArray) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Return all the elements of a two-dimensional array, in ascending order.
|
||||
*/
|
||||
AS_EXTERN NSArray *ASElementsInTwoDimensionalArray(NSArray<NSArray *>* twoDimensionalArray) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN NSArray *ASElementsInTwoDimensionalArray(NSArray<NSArray *>* twoDimensionalArray) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
/**
|
||||
* Attempt to get the object at the given index path. Returns @c nil if the index path is out of bounds.
|
||||
*/
|
||||
AS_EXTERN id _Nullable ASGetElementInTwoDimensionalArray(NSArray<NSArray *> *array, NSIndexPath *indexPath) AS_WARN_UNUSED_RESULT;
|
||||
ASDK_EXTERN id _Nullable ASGetElementInTwoDimensionalArray(NSArray<NSArray *> *array, NSIndexPath *indexPath) AS_WARN_UNUSED_RESULT;
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#import <AsyncDisplayKit/ASStackLayoutSpec.h>
|
||||
|
||||
/** The threshold that determines if a violation has actually occurred. */
|
||||
AS_EXTERN CGFloat const kViolationEpsilon;
|
||||
ASDK_EXTERN CGFloat const kViolationEpsilon;
|
||||
|
||||
struct ASStackLayoutSpecChild {
|
||||
/** The original source child. */
|
||||
|
||||
@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
The max text container size in layout.
|
||||
*/
|
||||
AS_EXTERN const CGSize ASTextContainerMaxSize;
|
||||
ASDK_EXTERN const CGSize ASTextContainerMaxSize;
|
||||
|
||||
/**
|
||||
The ASTextContainer class defines a region in which text is laid out.
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef NS_OPTIONS(NSInteger, ASTextAttributeType) {
|
||||
};
|
||||
|
||||
/// Get the attribute type from an attribute name.
|
||||
AS_EXTERN ASTextAttributeType ASTextAttributeGetType(NSString *attributeName);
|
||||
ASDK_EXTERN ASTextAttributeType ASTextAttributeGetType(NSString *attributeName);
|
||||
|
||||
/**
|
||||
Line style in ASText (similar to NSUnderlineStyle).
|
||||
|
||||
@@ -34,21 +34,21 @@
|
||||
@param obj ASDisplayNode, CALayer or object that conforms to `ASResizableContents` protocol
|
||||
@param image Image you would like to resize
|
||||
*/
|
||||
AS_EXTERN void ASDisplayNodeSetResizableContents(id<ASResizableContents> obj, UIImage *image);
|
||||
ASDK_EXTERN void ASDisplayNodeSetResizableContents(id<ASResizableContents> obj, UIImage *image);
|
||||
|
||||
/**
|
||||
Turns a value of UIViewContentMode to a string for debugging or serialization
|
||||
@param contentMode Any of the UIViewContentMode constants
|
||||
@return A human-readable representation of the constant, or the integer value of the constant if not recognized.
|
||||
*/
|
||||
AS_EXTERN NSString *ASDisplayNodeNSStringFromUIContentMode(UIViewContentMode contentMode);
|
||||
ASDK_EXTERN NSString *ASDisplayNodeNSStringFromUIContentMode(UIViewContentMode contentMode);
|
||||
|
||||
/**
|
||||
Turns a string representing a contentMode into a contentMode
|
||||
@param string Any of the strings in UIContentModeDescriptionLUT
|
||||
@return Any of the UIViewContentMode constants, or an int if the string is a number. If the string is not recognized, UIViewContentModeScaleToFill is returned.
|
||||
*/
|
||||
AS_EXTERN UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *string);
|
||||
ASDK_EXTERN UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *string);
|
||||
|
||||
/**
|
||||
Maps a value of UIViewContentMode to a corresponding contentsGravity
|
||||
@@ -56,7 +56,7 @@ AS_EXTERN UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *str
|
||||
@param contentMode A content mode except for UIViewContentModeRedraw, which has no corresponding contentsGravity (it corresponds to needsDisplayOnBoundsChange = YES)
|
||||
@return An NSString constant from the documentation, eg kCAGravityCenter... or nil if there is no corresponding contentsGravity. Will assert if contentMode is unknown.
|
||||
*/
|
||||
AS_EXTERN NSString *const ASDisplayNodeCAContentsGravityFromUIContentMode(UIViewContentMode contentMode);
|
||||
ASDK_EXTERN NSString *const ASDisplayNodeCAContentsGravityFromUIContentMode(UIViewContentMode contentMode);
|
||||
|
||||
/**
|
||||
Maps a value of contentsGravity to a corresponding UIViewContentMode
|
||||
@@ -64,21 +64,21 @@ AS_EXTERN NSString *const ASDisplayNodeCAContentsGravityFromUIContentMode(UIView
|
||||
@param contentsGravity A contents gravity
|
||||
@return A UIViewContentMode constant from UIView.h, eg UIViewContentModeCenter..., or UIViewContentModeScaleToFill if contentsGravity is not one of the CA constants. Will assert if the contentsGravity is unknown.
|
||||
*/
|
||||
AS_EXTERN UIViewContentMode ASDisplayNodeUIContentModeFromCAContentsGravity(NSString *const contentsGravity);
|
||||
ASDK_EXTERN UIViewContentMode ASDisplayNodeUIContentModeFromCAContentsGravity(NSString *const contentsGravity);
|
||||
|
||||
/**
|
||||
Use this to create a stretchable appropriate to approximate a filled rectangle, but with antialiasing on the edges when not pixel-aligned. It's best to keep the layer this image is added to with contentsScale equal to the scale of the final transform to screen space so it is able to antialias appropriately even when you shrink or grow the layer.
|
||||
@param color the fill color to use in the center of the image
|
||||
@param innerSize Unfortunately, 4 seems to be the smallest inner size that works if you're applying this stretchable to a larger box, whereas it does not display correctly for larger boxes. Thus some adjustment is necessary for the size of box you're displaying. If you're showing a 1px horizontal line, pass 1 height and at least 4 width. 2px vertical line: 2px wide, 4px high. Passing an innerSize greater that you desire is wasteful
|
||||
*/
|
||||
AS_EXTERN UIImage *ASDisplayNodeStretchableBoxContentsWithColor(UIColor *color, CGSize innerSize);
|
||||
ASDK_EXTERN UIImage *ASDisplayNodeStretchableBoxContentsWithColor(UIColor *color, CGSize innerSize);
|
||||
|
||||
/**
|
||||
Checks whether a layer has ongoing animations
|
||||
@param layer A layer to check if animations are ongoing
|
||||
@return YES if the layer has ongoing animations, otherwise NO
|
||||
*/
|
||||
AS_EXTERN BOOL ASDisplayNodeLayerHasAnimations(CALayer *layer);
|
||||
ASDK_EXTERN BOOL ASDisplayNodeLayerHasAnimations(CALayer *layer);
|
||||
|
||||
// This function is a less generalized version of ASDisplayNodeSetResizableContents.
|
||||
AS_EXTERN void ASDisplayNodeSetupLayerContentsWithResizableImage(CALayer *layer, UIImage *image) ASDISPLAYNODE_DEPRECATED;
|
||||
ASDK_EXTERN void ASDisplayNodeSetupLayerContentsWithResizableImage(CALayer *layer, UIImage *image) ASDISPLAYNODE_DEPRECATED;
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
#import <AsyncDisplayKit/ASEqualityHelpers.h>
|
||||
|
||||
AS_EXTERN NSString *const ASTextKitTruncationAttributeName;
|
||||
ASDK_EXTERN NSString *const ASTextKitTruncationAttributeName;
|
||||
/**
|
||||
Use ASTextKitEntityAttribute as the value of this attribute to embed a link or other interactable content inside the
|
||||
text.
|
||||
*/
|
||||
AS_EXTERN NSString *const ASTextKitEntityAttributeName;
|
||||
ASDK_EXTERN NSString *const ASTextKitEntityAttributeName;
|
||||
|
||||
/**
|
||||
All NSObject values in this struct should be copied when passed into the TextComponent.
|
||||
|
||||
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- kCTUnderlineColorAttributeName
|
||||
@result Whether attributeName is an unsupported Core Text attribute.
|
||||
*/
|
||||
AS_EXTERN BOOL ASAttributeWithNameIsUnsupportedCoreTextAttribute(NSString *attributeName);
|
||||
ASDK_EXTERN BOOL ASAttributeWithNameIsUnsupportedCoreTextAttribute(NSString *attributeName);
|
||||
|
||||
|
||||
/**
|
||||
@@ -54,14 +54,14 @@ AS_EXTERN BOOL ASAttributeWithNameIsUnsupportedCoreTextAttribute(NSString *attri
|
||||
- kCTUnderlineColorAttributeName
|
||||
@result An NSDictionary of attributes for use by NSAttributedString.
|
||||
*/
|
||||
AS_EXTERN NSDictionary *NSAttributedStringAttributesForCoreTextAttributes(NSDictionary *coreTextAttributes);
|
||||
ASDK_EXTERN NSDictionary *NSAttributedStringAttributesForCoreTextAttributes(NSDictionary *coreTextAttributes);
|
||||
|
||||
/**
|
||||
@abstract Returns an NSAttributedString whose Core Text attributes have been converted, where possible, to NSAttributedString attributes.
|
||||
@param dirtyAttributedString An NSAttributedString that may contain Core Text attributes.
|
||||
@result An NSAttributedString that's preserved as many CFAttributedString attributes as possible.
|
||||
*/
|
||||
AS_EXTERN NSAttributedString *ASCleanseAttributedStringOfCoreTextAttributes(NSAttributedString *dirtyAttributedString);
|
||||
ASDK_EXTERN NSAttributedString *ASCleanseAttributedStringOfCoreTextAttributes(NSAttributedString *dirtyAttributedString);
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark -
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ASViewControllerTests.mm
|
||||
// ASDKViewControllerTests.mm
|
||||
// Texture
|
||||
//
|
||||
// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
||||
@@ -15,11 +15,11 @@
|
||||
|
||||
#import "NSInvocation+ASTestHelpers.h"
|
||||
|
||||
@interface ASViewControllerTests : XCTestCase
|
||||
@interface ASDKViewControllerTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASViewControllerTests
|
||||
@implementation ASDKViewControllerTests
|
||||
|
||||
- (void)testThatAutomaticSubnodeManagementScrollViewInsetsAreApplied
|
||||
{
|
||||
@@ -32,7 +32,7 @@
|
||||
node.layoutSpecBlock = ^(ASDisplayNode *node, ASSizeRange constrainedSize){
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsZero child:scrollNode];
|
||||
};
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
window.rootViewController = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
[window makeKeyAndVisible];
|
||||
[window layoutIfNeeded];
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
ASDisplayNode *node = [[ASDisplayNode alloc] init];
|
||||
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
vc.node.backgroundColor = [UIColor greenColor];
|
||||
vc.edgesForExtendedLayout = UIRectEdgeNone;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#import <AsyncDisplayKit/ASBackgroundLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASInternalHelpers.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
|
||||
#import "ASXCTExtensions.h"
|
||||
#import "ASDisplayNodeTestsHelper.h"
|
||||
@@ -274,7 +274,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\
|
||||
}
|
||||
@end
|
||||
|
||||
@interface ASTestViewController: ASViewController<ASDisplayNode *>
|
||||
@interface ASTestViewController: ASDKViewController<ASDisplayNode *>
|
||||
@end
|
||||
@implementation ASTestViewController
|
||||
- (BOOL)prefersStatusBarHidden { return YES; }
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
typedef BOOL (^as_condition_block_t)(void);
|
||||
|
||||
AS_EXTERN BOOL ASDisplayNodeRunRunLoopUntilBlockIsTrue(as_condition_block_t block);
|
||||
ASDK_EXTERN BOOL ASDisplayNodeRunRunLoopUntilBlockIsTrue(as_condition_block_t block);
|
||||
|
||||
AS_EXTERN void ASDisplayNodeSizeToFitSize(ASDisplayNode *node, CGSize size);
|
||||
AS_EXTERN void ASDisplayNodeSizeToFitSizeRange(ASDisplayNode *node, ASSizeRange sizeRange);
|
||||
AS_EXTERN void ASCATransactionQueueWait(ASCATransactionQueue *q); // nil means shared queue
|
||||
ASDK_EXTERN void ASDisplayNodeSizeToFitSize(ASDisplayNode *node, CGSize size);
|
||||
ASDK_EXTERN void ASDisplayNodeSizeToFitSizeRange(ASDisplayNode *node, ASSizeRange sizeRange);
|
||||
ASDK_EXTERN void ASCATransactionQueueWait(ASCATransactionQueue *q); // nil means shared queue
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#import <AsyncDisplayKit/ASConfiguration.h>
|
||||
#import <AsyncDisplayKit/ASConfigurationInternal.h>
|
||||
#import <AsyncDisplayKit/ASScrollNode.h>
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import <OCMock/OCMock.h>
|
||||
#import "ASDisplayNodeTestsHelper.h"
|
||||
|
||||
@@ -339,7 +339,7 @@ extern void SortAccessibilityElements(NSMutableArray *elements);
|
||||
ASDisplayNode *node = [[ASDisplayNode alloc] init];
|
||||
node.automaticallyManagesSubnodes = YES;
|
||||
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
window.rootViewController = vc;
|
||||
[window makeKeyAndVisible];
|
||||
[window layoutIfNeeded];
|
||||
@@ -389,7 +389,7 @@ extern void SortAccessibilityElements(NSMutableArray *elements);
|
||||
ASScrollNode *node = [[ASScrollNode alloc] init];
|
||||
node.automaticallyManagesSubnodes = YES;
|
||||
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
window.rootViewController = vc;
|
||||
[window makeKeyAndVisible];
|
||||
[window layoutIfNeeded];
|
||||
@@ -494,7 +494,7 @@ extern void SortAccessibilityElements(NSMutableArray *elements);
|
||||
ASDisplayNode *node = [[ASDisplayNode alloc] init];
|
||||
node.automaticallyManagesSubnodes = YES;
|
||||
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
window.rootViewController = vc;
|
||||
[window makeKeyAndVisible];
|
||||
[window layoutIfNeeded];
|
||||
@@ -535,7 +535,7 @@ extern void SortAccessibilityElements(NSMutableArray *elements);
|
||||
ASDisplayNode *node = [[ASDisplayNode alloc] init];
|
||||
node.automaticallyManagesSubnodes = YES;
|
||||
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
window.rootViewController = vc;
|
||||
[window makeKeyAndVisible];
|
||||
[window layoutIfNeeded];
|
||||
@@ -597,7 +597,7 @@ extern void SortAccessibilityElements(NSMutableArray *elements);
|
||||
ASDisplayNode *node = [[ASDisplayNode alloc] init];
|
||||
node.automaticallyManagesSubnodes = YES;
|
||||
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
window.rootViewController = vc;
|
||||
[window makeKeyAndVisible];
|
||||
[window layoutIfNeeded];
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
@implementation ASNavigationControllerTests
|
||||
|
||||
- (void)testSetViewControllers {
|
||||
ASViewController *firstController = [ASViewController new];
|
||||
ASViewController *secondController = [ASViewController new];
|
||||
ASDKViewController *firstController = [ASDKViewController new];
|
||||
ASDKViewController *secondController = [ASDKViewController new];
|
||||
NSArray *expectedViewControllerStack = @[firstController, secondController];
|
||||
ASNavigationController *navigationController = [ASNavigationController new];
|
||||
[navigationController setViewControllers:@[firstController, secondController]];
|
||||
@@ -27,8 +27,8 @@
|
||||
}
|
||||
|
||||
- (void)testPopViewController {
|
||||
ASViewController *firstController = [ASViewController new];
|
||||
ASViewController *secondController = [ASViewController new];
|
||||
ASDKViewController *firstController = [ASDKViewController new];
|
||||
ASDKViewController *secondController = [ASDKViewController new];
|
||||
NSArray *expectedViewControllerStack = @[firstController];
|
||||
ASNavigationController *navigationController = [ASNavigationController new];
|
||||
[navigationController setViewControllers:@[firstController, secondController]];
|
||||
@@ -39,8 +39,8 @@
|
||||
}
|
||||
|
||||
- (void)testPushViewController {
|
||||
ASViewController *firstController = [ASViewController new];
|
||||
ASViewController *secondController = [ASViewController new];
|
||||
ASDKViewController *firstController = [ASDKViewController new];
|
||||
ASDKViewController *secondController = [ASDKViewController new];
|
||||
NSArray *expectedViewControllerStack = @[firstController, secondController];
|
||||
ASNavigationController *navigationController = [[ASNavigationController new] initWithRootViewController:firstController];
|
||||
[navigationController pushViewController:secondController animated:false];
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
node.layoutSpecBlock = ^(ASDisplayNode *node, ASSizeRange constrainedSize){
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsZero child:pagerNode];
|
||||
};
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
|
||||
window.rootViewController = nav;
|
||||
[window makeKeyAndVisible];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import <AsyncDisplayKit/ASTabBarController.h>
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
|
||||
@interface ASTabBarControllerTests: XCTestCase
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
@implementation ASTabBarControllerTests
|
||||
|
||||
- (void)testTabBarControllerSelectIndex {
|
||||
ASViewController *firstViewController = [ASViewController new];
|
||||
ASViewController *secondViewController = [ASViewController new];
|
||||
ASDKViewController *firstViewController = [ASDKViewController new];
|
||||
ASDKViewController *secondViewController = [ASDKViewController new];
|
||||
NSArray *viewControllers = @[firstViewController, secondViewController];
|
||||
ASTabBarController *tabBarController = [ASTabBarController new];
|
||||
[tabBarController setViewControllers:viewControllers];
|
||||
@@ -28,8 +28,8 @@
|
||||
}
|
||||
|
||||
- (void)testTabBarControllerSelectViewController {
|
||||
ASViewController *firstViewController = [ASViewController new];
|
||||
ASViewController *secondViewController = [ASViewController new];
|
||||
ASDKViewController *firstViewController = [ASDKViewController new];
|
||||
ASDKViewController *secondViewController = [ASDKViewController new];
|
||||
NSArray *viewControllers = @[firstViewController, secondViewController];
|
||||
ASTabBarController *tabBarController = [ASTabBarController new];
|
||||
[tabBarController setViewControllers:viewControllers];
|
||||
|
||||
@@ -776,7 +776,7 @@
|
||||
ASTableViewFilledDataSource *ds = [[ASTableViewFilledDataSource alloc] init];
|
||||
ds.rowsPerSection = 1;
|
||||
node.dataSource = ds;
|
||||
ASViewController *vc = [[ASViewController alloc] initWithNode:node];
|
||||
ASDKViewController *vc = [[ASDKViewController alloc] initWithNode:node];
|
||||
UITabBarController *tabCtrl = [[UITabBarController alloc] init];
|
||||
tabCtrl.viewControllers = @[ vc ];
|
||||
tabCtrl.tabBar.translucent = NO;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
Got a tip for upgrading? Please open a PR to this document!
|
||||
|
||||
- Rename all instances of ASViewController to ASDKViewController
|
||||
|
||||
### Breaking API Changes
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
title: ASViewController
|
||||
title: ASDKViewController
|
||||
layout: docs
|
||||
permalink: /docs/asviewcontroller.html
|
||||
permalink: /docs/ASDKViewController.html
|
||||
prevPage:
|
||||
nextPage: aspagernode.html
|
||||
---
|
||||
|
||||
`ASViewController` is a direct subclass of `UIViewController`. For the most part, it can be used in place of any `UIViewController` relatively easily.
|
||||
`ASDKViewController` is a direct subclass of `UIViewController`. For the most part, it can be used in place of any `UIViewController` relatively easily.
|
||||
|
||||
The main difference is that you construct and return the node you'd like managed as opposed to the way `UIViewController` provides a view of its own.
|
||||
|
||||
Consider the following `ASViewController` subclass that would like to use a custom table node as its managed node.
|
||||
Consider the following `ASDKViewController` subclass that would like to use a custom table node as its managed node.
|
||||
|
||||
<div class = "highlight-group">
|
||||
<span class="language-toggle"><a data-lang="swift" class="swiftButton">Swift</a><a data-lang="objective-c" class = "active objcButton">Objective-C</a></span>
|
||||
@@ -52,4 +52,4 @@ The most important line is:
|
||||
|
||||
`if (!(self = [super initWithNode:tableNode])) { return nil; }`
|
||||
|
||||
As you can see, `ASViewController`'s are initialized with a node of your choosing.
|
||||
As you can see, `ASDKViewController`'s are initialized with a node of your choosing.
|
||||
@@ -71,7 +71,7 @@ This is the function that will recursively call through its underlying tree of n
|
||||
|
||||

|
||||
|
||||
This is what a typical call stack will look like for the layout of an `ASViewController` with a simple view hierarchy. Here we clicked on the "Photo with outset icon overlay" in the Layout Specs Examples project. Breakpointing on the `-[PhotoWithOutsetIconOverlay layoutSpecThatFits:]` reveals that call stack.
|
||||
This is what a typical call stack will look like for the layout of an `ASDKViewController` with a simple view hierarchy. Here we clicked on the "Photo with outset icon overlay" in the Layout Specs Examples project. Breakpointing on the `-[PhotoWithOutsetIconOverlay layoutSpecThatFits:]` reveals that call stack.
|
||||
|
||||
The first significant branch of logic is the top level `-[ASDisplayNode calculateLayoutThatFits]` where it will choose between the Texture Layout and the Yoga engine.
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ As mentioned above, ASDeallocQueue helps to defer the deallocation of objects gi
|
||||
|
||||
# Nodes that are not managed by containers
|
||||
|
||||
These are nodes that are often directly created by client code, such as direct and indirect subnodes of cell nodes. When a node is added to a parent node, the parent node retains it until it's removed from the parent node, or until the parent node is deallocated. As a result, if the subnode is not retained by client code in any other way or if it's not removed from the parent node, the subnode's lifecycle is tied to the parent node's lifecycle. In addition, since nodes often live in a hierarchy, the entire node hierarchy has the same lifecycle as the root node's. Lastly, if the root node is managed by a node container -- directly in the case of ASViewController and the like, or indirectly as a cell node of a collection or table node --, then the entire node hierarchy is managed by the node container.
|
||||
These are nodes that are often directly created by client code, such as direct and indirect subnodes of cell nodes. When a node is added to a parent node, the parent node retains it until it's removed from the parent node, or until the parent node is deallocated. As a result, if the subnode is not retained by client code in any other way or if it's not removed from the parent node, the subnode's lifecycle is tied to the parent node's lifecycle. In addition, since nodes often live in a hierarchy, the entire node hierarchy has the same lifecycle as the root node's. Lastly, if the root node is managed by a node container -- directly in the case of ASDKViewController and the like, or indirectly as a cell node of a collection or table node --, then the entire node hierarchy is managed by the node container.
|
||||
|
||||
## Node lifecycle under [Automatic Subnode Management (ASM)](/docs/automatic-subnode-mgmt.html)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ permalink: /docs/subclassing.html
|
||||
prevPage: node-overview.html
|
||||
nextPage: faq.html
|
||||
---
|
||||
The most important distinction when creating a subclass is whether you writing an ASViewController or an ASDisplayNode. This sounds obvious, but because some of these differences are subtle, it is important to keep this top of mind.
|
||||
The most important distinction when creating a subclass is whether you writing an ASDKViewController or an ASDisplayNode. This sounds obvious, but because some of these differences are subtle, it is important to keep this top of mind.
|
||||
|
||||
## ASDisplayNode
|
||||
<br>
|
||||
@@ -43,17 +43,17 @@ One great use of `-layout` is for the specific case in which you want a subnode
|
||||
subnode.frame = self.bounds;
|
||||
```
|
||||
|
||||
If you desire the same effect in a ASViewController, you can do the same thing in -viewWillLayoutSubviews, unless your node is the node in initWithNode: and in that case it will do this automatically.
|
||||
If you desire the same effect in a ASDKViewController, you can do the same thing in -viewWillLayoutSubviews, unless your node is the node in initWithNode: and in that case it will do this automatically.
|
||||
|
||||
## ASViewController
|
||||
## ASDKViewController
|
||||
<br>
|
||||
An `ASViewController` is a regular `UIViewController` subclass that has special features to manage nodes. Since it is a UIViewController subclass, all methods are called on the **main thread** (and you should always create an ASViewController on the main thread).
|
||||
An `ASDKViewController` is a regular `UIViewController` subclass that has special features to manage nodes. Since it is a UIViewController subclass, all methods are called on the **main thread** (and you should always create an ASDKViewController on the main thread).
|
||||
|
||||
### `-init`
|
||||
|
||||
This method is called once, at the very beginning of an ASViewController's lifecycle. As with UIViewController initialization, it is best practice to **never access** `self.view` or `self.node.view` in this method as it will force the view to be created early. Instead, do any view access in -viewDidLoad.
|
||||
This method is called once, at the very beginning of an ASDKViewController's lifecycle. As with UIViewController initialization, it is best practice to **never access** `self.view` or `self.node.view` in this method as it will force the view to be created early. Instead, do any view access in -viewDidLoad.
|
||||
|
||||
ASViewController's designated initializer is `initWithNode:`. A typical initializer will look something like the code below. Note how the ASViewController's node is created _before_ calling super. An ASViewController manages a node similarly to how a UIViewController manages a view, but the initialization is slightly different.
|
||||
ASDKViewController's designated initializer is `initWithNode:`. A typical initializer will look something like the code below. Note how the ASDKViewController's node is created _before_ calling super. An ASDKViewController manages a node similarly to how a UIViewController manages a view, but the initialization is slightly different.
|
||||
|
||||
|
||||
<div class = "highlight-group">
|
||||
@@ -93,18 +93,18 @@ We recommend that you do not use this method because it is has no particular adv
|
||||
|
||||
### `-viewDidLoad`
|
||||
|
||||
This method is called once in a ASViewController's lifecycle, immediately after `-loadView`. This is the earliest time at which you should access the node's view. It is a great spot to put any **setup code that should only be run once and requires access to the view/layer**, such as adding a gesture recognizer.
|
||||
This method is called once in a ASDKViewController's lifecycle, immediately after `-loadView`. This is the earliest time at which you should access the node's view. It is a great spot to put any **setup code that should only be run once and requires access to the view/layer**, such as adding a gesture recognizer.
|
||||
|
||||
Layout code should never be put in this method, because it will not be called again when geometry changes. Note this is equally true for UIViewController; it is bad practice to put layout code in this method even if you don't currently expect geometry changes.
|
||||
|
||||
### `-viewWillLayoutSubviews`
|
||||
|
||||
This method is called at the exact same time as a node's `-layout` method and it may be called multiple times in a ASViewController's lifecycle; it will be called whenever the bounds of the ASViewController's node are changed (including rotation, split screen, keyboard presentation) as well as when there are changes to the hierarchy (children being added, removed, or changed in size).
|
||||
This method is called at the exact same time as a node's `-layout` method and it may be called multiple times in a ASDKViewController's lifecycle; it will be called whenever the bounds of the ASDKViewController's node are changed (including rotation, split screen, keyboard presentation) as well as when there are changes to the hierarchy (children being added, removed, or changed in size).
|
||||
|
||||
For consistency, it is best practice to put all layout code in this method. Because it is not called very frequently, even code that does not directly depend on the size belongs here.
|
||||
|
||||
### `-viewWillAppear:` / `-viewDidDisappear:`
|
||||
|
||||
These methods are called just before the ASViewController's node appears on screen (the earliest time that it is visible) and just after it is removed from the view hierarchy (the earliest time that it is no longer visible). These methods provide a good opportunity to start or stop animations related to the presentation or dismissal of your controller. This is also a good place to make a log of a user action.
|
||||
These methods are called just before the ASDKViewController's node appears on screen (the earliest time that it is visible) and just after it is removed from the view hierarchy (the earliest time that it is no longer visible). These methods provide a good opportunity to start or stop animations related to the presentation or dismissal of your controller. This is also a good place to make a log of a user action.
|
||||
|
||||
Although these methods may be called multiple times and geometry information is available, they are not called for all geometry changes and so should not be used for core layout code (beyond setup required for specific animations).
|
||||
|
||||
@@ -6,7 +6,7 @@ prevPage: subtree-rasterization.html
|
||||
nextPage: corner-rounding.html
|
||||
---
|
||||
|
||||
Both `ASViewController` and `ASCellNode` have a property called `neverShowPlaceholders`.
|
||||
Both `ASDKViewController` and `ASCellNode` have a property called `neverShowPlaceholders`.
|
||||
|
||||
By setting this property to YES, the main thread will be blocked until display has completed for the cell or view controller's view.
|
||||
|
||||
@@ -27,6 +27,6 @@ node.neverShowPlaceholders = true
|
||||
</div>
|
||||
<br>
|
||||
|
||||
Usually, if a cell hasn't finished its display pass before it has reached the screen it will show placeholders until it has drawing its content. Setting this option to YES makes your scrolling node or ASViewController act more like UIKit, and in fact makes Texture scrolling visually indistinguishable from UIKit's, except that it's faster.
|
||||
Usually, if a cell hasn't finished its display pass before it has reached the screen it will show placeholders until it has drawing its content. Setting this option to YES makes your scrolling node or ASDKViewController act more like UIKit, and in fact makes Texture scrolling visually indistinguishable from UIKit's, except that it's faster.
|
||||
|
||||
<img src="/static/images/synchronous-concurrency.jpg" width="50%">
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface VideoFeedNodeController : ASViewController
|
||||
@interface VideoFeedNodeController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
@protocol PhotoFeedControllerProtocol;
|
||||
@class PhotoFeedModel;
|
||||
|
||||
@interface PhotoFeedBaseController : ASViewController <PhotoFeedControllerProtocol>
|
||||
@interface PhotoFeedBaseController : ASDKViewController <PhotoFeedControllerProtocol>
|
||||
|
||||
@property (nonatomic, strong, readonly) PhotoFeedModel *photoFeed;
|
||||
@property (nonatomic, strong, readonly) UITableView *tableView;
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
#import "PhotoFeedControllerProtocol.h"
|
||||
|
||||
@interface PhotoFeedListKitViewController<ASCollectionNode> : ASViewController <PhotoFeedControllerProtocol>
|
||||
@interface PhotoFeedListKitViewController<ASCollectionNode> : ASDKViewController <PhotoFeedControllerProtocol>
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import "DetailRootNode.h"
|
||||
|
||||
@interface DetailViewController : ASViewController<DetailRootNode *>
|
||||
@interface DetailViewController : ASDKViewController<DetailRootNode *>
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASViewController.h>
|
||||
#import <AsyncDisplayKit/ASDKViewController.h>
|
||||
#import <AsyncDisplayKit/ASTableNode.h>
|
||||
|
||||
@interface ViewController : ASViewController<ASTableNode *>
|
||||
@interface ViewController : ASDKViewController<ASTableNode *>
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
@end
|
||||
|
||||
@interface OverviewComponentsViewController : ASViewController
|
||||
@interface OverviewComponentsViewController : ASDKViewController
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
|
||||
class ViewController: ASViewController<ASCollectionNode>, MosaicCollectionViewLayoutDelegate, ASCollectionDataSource, ASCollectionDelegate {
|
||||
class ViewController: ASDKViewController<ASCollectionNode>, MosaicCollectionViewLayoutDelegate, ASCollectionDataSource, ASCollectionDelegate {
|
||||
|
||||
var _sections = [[UIImage]]()
|
||||
let _collectionNode: ASCollectionNode
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import AsyncDisplayKit
|
||||
|
||||
class LayoutExampleViewController: ASViewController<ASDisplayNode> {
|
||||
class LayoutExampleViewController: ASDKViewController<ASDisplayNode> {
|
||||
|
||||
let customNode: LayoutExampleNode
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import AsyncDisplayKit
|
||||
|
||||
class OverviewViewController: ASViewController<ASTableNode> {
|
||||
class OverviewViewController: ASDKViewController<ASTableNode> {
|
||||
let tableNode = ASTableNode()
|
||||
let layoutExamples: [LayoutExampleNode.Type]
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface LayoutExampleViewController : ASViewController
|
||||
@interface LayoutExampleViewController : ASDKViewController
|
||||
- (instancetype)initWithLayoutExampleClass:(Class)layoutExampleClass NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)initWithNode:(ASDisplayNode *)node NS_UNAVAILABLE;
|
||||
@end
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
|
||||
@interface OverviewViewController : ASViewController
|
||||
@interface OverviewViewController : ASDKViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController<ASPagerNode *>
|
||||
@interface ViewController : ASDKViewController<ASPagerNode *>
|
||||
|
||||
@end
|
||||
|
||||
+6
-6
@@ -36,12 +36,12 @@ Featuring:
|
||||
|
||||

|
||||
|
||||
### ASViewController [ObjC]
|
||||
### ASDKViewController [ObjC]
|
||||
|
||||

|
||||

|
||||
|
||||
Featuring:
|
||||
- ASViewController
|
||||
- ASDKViewController
|
||||
- ASTableView
|
||||
- ASMultiplexImageNode
|
||||
- ASLayoutSpec
|
||||
@@ -56,7 +56,7 @@ Featuring:
|
||||
|
||||
Featuring:
|
||||
- ASDK Swift compatibility
|
||||
- ASViewController
|
||||
- ASDKViewController
|
||||
- ASCollectionView
|
||||
- thread affinity
|
||||
- ASLayoutSpec
|
||||
@@ -150,7 +150,7 @@ Featuring:
|
||||

|
||||
|
||||
Featuring:
|
||||
- ASViewController with ASTableNode
|
||||
- ASDKViewController with ASTableNode
|
||||
|
||||
### SynchronousConcurrency [ObjC]
|
||||
|
||||
@@ -169,7 +169,7 @@ The internal features are:
|
||||
|
||||
Also provided are two such implementations:
|
||||
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
|
||||
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.
|
||||
-[ASDKViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.
|
||||
|
||||
Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
|
||||
to exempt themselves from blocking the main thread on their display.
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
@end
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface ViewController : ASViewController
|
||||
@interface ViewController : ASDKViewController
|
||||
@end
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
|
||||
final class ViewController: ASViewController<ASDisplayNode>, ASTableDataSource, ASTableDelegate {
|
||||
final class ViewController: ASDKViewController<ASDisplayNode>, ASTableDataSource, ASTableDelegate {
|
||||
|
||||
struct State {
|
||||
var itemCount: Int
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import AsyncDisplayKit
|
||||
|
||||
class PhotoFeedTableNodeController: ASViewController<ASTableNode> {
|
||||
class PhotoFeedTableNodeController: ASDKViewController<ASTableNode> {
|
||||
|
||||
// MARK: Lifecycle
|
||||
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
|
||||
@interface CollectionViewController : ASViewController<ASCollectionNode *>
|
||||
@interface CollectionViewController : ASDKViewController<ASCollectionNode *>
|
||||
@end
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
|
||||
// The default action when an image node is tapped. This action will create an
|
||||
// OverrideVC and override its display traits to always be compact.
|
||||
+ (void)defaultImageTappedAction:(ASViewController *)sourceViewController;
|
||||
+ (void)defaultImageTappedAction:(ASDKViewController *)sourceViewController;
|
||||
@end
|
||||
|
||||
@@ -143,7 +143,7 @@ static const CGFloat kInnerPadding = 10.0f;
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding) child:stackSpec];
|
||||
}
|
||||
|
||||
+ (void)defaultImageTappedAction:(ASViewController *)sourceViewController
|
||||
+ (void)defaultImageTappedAction:(ASDKViewController *)sourceViewController
|
||||
{
|
||||
OverrideViewController *overrideVC = [[OverrideViewController alloc] init];
|
||||
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
* This is a fairly stupid VC that's main purpose is to show how to override ASDisplayTraits.
|
||||
* Take a look at `defaultImageTappedAction` in KittenNode to see how this is accomplished.
|
||||
*/
|
||||
@interface OverrideViewController : ASViewController<OverrideNode *>
|
||||
@interface OverrideViewController : ASDKViewController<OverrideNode *>
|
||||
@property (nonatomic, copy) dispatch_block_t closeBlock;
|
||||
@end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user