Skip to content

Make a streamline ASDK version #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1cf43dc
feat: remove ASTextNode2
junjielu Aug 26, 2021
95c81cb
feat: remove ASVideo related
junjielu Aug 26, 2021
e817978
feat: remove map related
junjielu Aug 26, 2021
07fb651
feat: remove photos related
junjielu Aug 26, 2021
1ff2674
feat: remove AssetsLibrary related
junjielu Aug 26, 2021
99e7fe4
feat: remove IGListKit related
junjielu Aug 26, 2021
dd2c1bd
feat: remove frameworks
junjielu Aug 26, 2021
58ed46b
feat: remove yoga
junjielu Aug 26, 2021
3102163
feat: remove PinRemoteImage related
junjielu Aug 26, 2021
d65d9e8
feat: remove nav tabbar pager and multiplex image
junjielu Aug 26, 2021
f893a9c
feat: remove tvos helper
junjielu Aug 26, 2021
d14c4f7
feat: remove ASNodeController related
junjielu Aug 26, 2021
0f93394
feat: remove ASDKViewController related
junjielu Aug 26, 2021
9116a6b
feat: remove text experiment related
junjielu Aug 26, 2021
487c661
feat: update config json
junjielu Aug 26, 2021
79c7bc1
feat: remove all experiment related
junjielu Aug 26, 2021
215e790
feat: simplify ASImageNode
junjielu Aug 26, 2021
00ef634
feat: remove unused code
junjielu Aug 27, 2021
d94a500
feat: remove safe area related
junjielu Aug 27, 2021
7be3cd0
fix: test
junjielu Aug 27, 2021
03dd6f2
feat: remove tvos related
junjielu Aug 27, 2021
5c9bec2
feat: remove collection data adapter
junjielu Aug 30, 2021
71e17b8
feat: simplify ASNetworkImageNode
junjielu Aug 30, 2021
bbeb49a
feat: simplify text node
junjielu Sep 1, 2021
49cd95e
feat: remove collection layout related
junjielu Sep 1, 2021
7cea8d0
feat: remove ASCollectionViewLayoutFacilitatorProtocol and ASCellLayo…
junjielu Sep 1, 2021
2d9f742
feat: remove ASCollectionLayoutDelegate
junjielu Sep 1, 2021
fddc367
feat: remove deprecated method of ASCollectionNode
junjielu Sep 1, 2021
179c898
feat: remove deprecated type for ASControlNode
junjielu Sep 1, 2021
931b6bf
feat: remove ASTableNode deprecated methods
junjielu Sep 1, 2021
5a049e8
feat: remove all deprecated methods
junjielu Sep 1, 2021
956cd3f
feat: remove tip and fix test
junjielu Sep 17, 2021
1562c88
feat: remove unused code from ASCellNode
junjielu Sep 18, 2021
9f16f0b
feat: remove unused code
junjielu Sep 18, 2021
8f5094d
Revert "feat: remove unused code from ASCellNode"
junjielu Sep 18, 2021
53fcb3e
feat: remove unused protocols and class
junjielu Sep 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
644 changes: 13 additions & 631 deletions AsyncDisplayKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: ff1a1777e31f49e6e4b7b148d0f10e504db7fa26

COCOAPODS: 1.9.1
COCOAPODS: 1.10.1
32 changes: 0 additions & 32 deletions Schemas/configuration.json

This file was deleted.

20 changes: 0 additions & 20 deletions Source/ASButtonNode+Yoga.h

This file was deleted.

105 changes: 0 additions & 105 deletions Source/ASButtonNode+Yoga.mm

This file was deleted.

19 changes: 1 addition & 18 deletions Source/ASButtonNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//

#import <AsyncDisplayKit/ASButtonNode+Private.h>
#import <AsyncDisplayKit/ASButtonNode+Yoga.h>
#import <AsyncDisplayKit/ASStackLayoutSpec.h>
#import <AsyncDisplayKit/ASThread.h>
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
Expand Down Expand Up @@ -41,8 +40,6 @@ - (instancetype)init
_contentEdgeInsets = UIEdgeInsetsZero;
_imageAlignment = ASButtonNodeImageAlignmentBeginning;
self.accessibilityTraits = self.defaultAccessibilityTraits;

[self updateYogaLayoutIfNeeded];
}
return self;
}
Expand All @@ -52,13 +49,7 @@ - (ASTextNode *)titleNode
ASLockScopeSelf();
if (!_titleNode) {
_titleNode = [[ASTextNode alloc] init];
#if TARGET_OS_TV
// tvOS needs access to the underlying view
// of the button node to add a touch handler.
[_titleNode setLayerBacked:NO];
#else
[_titleNode setLayerBacked:YES];
#endif
[_titleNode setLayerBacked:YES];
_titleNode.style.flexShrink = 1.0;
_titleNode.textColorFollowsTintColor = YES;
}
Expand Down Expand Up @@ -169,7 +160,6 @@ - (void)updateImage
_imageNode.image = newImage;
[self unlock];

[self updateYogaLayoutIfNeeded];
[self setNeedsLayout];
return;
}
Expand Down Expand Up @@ -201,7 +191,6 @@ - (void)updateTitle
[self unlock];

self.accessibilityLabel = self.defaultAccessibilityLabel;
[self updateYogaLayoutIfNeeded];
[self setNeedsLayout];
return;
}
Expand Down Expand Up @@ -230,7 +219,6 @@ - (void)updateBackgroundImage
_backgroundImageNode.image = newImage;
[self unlock];

[self updateYogaLayoutIfNeeded];
[self setNeedsLayout];
return;
}
Expand All @@ -247,7 +235,6 @@ - (CGFloat)contentSpacing
- (void)setContentSpacing:(CGFloat)contentSpacing
{
if (ASLockedSelfCompareAssign(_contentSpacing, contentSpacing)) {
[self updateYogaLayoutIfNeeded];
[self setNeedsLayout];
}
}
Expand All @@ -261,7 +248,6 @@ - (BOOL)laysOutHorizontally
- (void)setLaysOutHorizontally:(BOOL)laysOutHorizontally
{
if (ASLockedSelfCompareAssign(_laysOutHorizontally, laysOutHorizontally)) {
[self updateYogaLayoutIfNeeded];
[self setNeedsLayout];
}
}
Expand Down Expand Up @@ -515,8 +501,6 @@ - (UIAccessibilityTraits)defaultAccessibilityTraits
}

#pragma mark - Layout

#if !YOGA
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{
UIEdgeInsets contentEdgeInsets;
Expand Down Expand Up @@ -561,7 +545,6 @@ - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize

return spec;
}
#endif

- (void)layout
{
Expand Down
17 changes: 5 additions & 12 deletions Source/ASCellNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#import <AsyncDisplayKit/ASTextNode.h>
#import <AsyncDisplayKit/ASCollectionNode.h>

#import <AsyncDisplayKit/ASDKViewController.h>
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>

Expand Down Expand Up @@ -79,17 +78,11 @@ - (void)didLoad
_viewController = _viewControllerBlock();
_viewControllerBlock = nil;

if ([_viewController isKindOfClass:[ASDKViewController class]]) {
ASDKViewController *asViewController = (ASDKViewController *)_viewController;
_viewControllerNode = asViewController.node;
[_viewController loadViewIfNeeded];
} else {
// Careful to avoid retain cycle
UIViewController *viewController = _viewController;
_viewControllerNode = [[ASDisplayNode alloc] initWithViewBlock:^{
return viewController.view;
}];
}
// Careful to avoid retain cycle
UIViewController *viewController = _viewController;
_viewControllerNode = [[ASDisplayNode alloc] initWithViewBlock:^{
return viewController.view;
}];
[self addSubnode:_viewControllerNode];

// Since we just loaded our node, and added _viewControllerNode as a subnode,
Expand Down
33 changes: 2 additions & 31 deletions Source/ASCollectionNode+Beta.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <AsyncDisplayKit/ASCollectionNode.h>

@protocol ASCollectionViewLayoutFacilitatorProtocol, ASCollectionLayoutDelegate, ASBatchFetchingDelegate;
@protocol ASBatchFetchingDelegate;
@class ASElementMap;

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -28,29 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, readonly) ASElementMap *visibleElements;

@property (nullable, readonly) id<ASCollectionLayoutDelegate> layoutDelegate;

@property (nullable, nonatomic, weak) id<ASBatchFetchingDelegate> batchFetchingDelegate;

/**
* When this mode is enabled, ASCollectionView matches the timing of UICollectionView as closely as
* possible, ensuring that all reload and edit operations are performed on the main thread as
* blocking calls.
*
* This mode is useful for applications that are debugging issues with their collection view
* implementation. In particular, some applications do not properly conform to the API requirement
* of UICollectionView, and these applications may experience difficulties with ASCollectionView.
* Providing this mode allows for developers to work towards resolving technical debt in their
* collection view data source, while ramping up asynchronous collection layout.
*
* NOTE: Because this mode results in expensive operations like cell layout being performed on the
* main thread, it should be used as a tool to resolve data source conformance issues with Apple
* collection view API.
*
* @default defaults to ASCellLayoutModeNone.
*/
@property (nonatomic) ASCellLayoutMode cellLayoutMode;

/**
* Returns YES if the ASCollectionNode contents are completely synchronized with the underlying collection-view layout.
*/
Expand All @@ -64,15 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)onDidFinishSynchronizing:(void (^)(void))didFinishSynchronizing;

- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(nullable id<ASCollectionViewLayoutFacilitatorProtocol>)layoutFacilitator;

- (instancetype)initWithLayoutDelegate:(id<ASCollectionLayoutDelegate>)layoutDelegate layoutFacilitator:(nullable id<ASCollectionViewLayoutFacilitatorProtocol>)layoutFacilitator;

- (void)beginUpdates ASDISPLAYNODE_DEPRECATED_MSG("Use -performBatchUpdates:completion: instead.");

- (void)endUpdatesAnimated:(BOOL)animated ASDISPLAYNODE_DEPRECATED_MSG("Use -performBatchUpdates:completion: instead.");

- (void)endUpdatesAnimated:(BOOL)animated completion:(nullable void (^)(BOOL))completion ASDISPLAYNODE_DEPRECATED_MSG("Use -performBatchUpdates:completion: instead.");
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout;

@end

Expand Down
Loading