Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 31eef22

Browse files
author
Dasmer Singh
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7fedfdd + 6703c95 commit 31eef22

227 files changed

Lines changed: 7326 additions & 1001 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* Copyright (c) 2014-present, Facebook, Inc.
2+
* All rights reserved.
3+
*
4+
* This source code is licensed under the BSD-style license found in the
5+
* LICENSE file in the root directory of this source tree. An additional grant
6+
* of patent rights can be found in the PATENTS file in the same directory.
7+
*/
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//! Project version number for AsyncDisplayKit-iOS.
12+
FOUNDATION_EXPORT double AsyncDisplayKit_iOSVersionNumber;
13+
14+
//! Project version string for AsyncDisplayKit-iOS.
15+
FOUNDATION_EXPORT const unsigned char AsyncDisplayKit_iOSVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <AsyncDisplayKit_iOS/PublicHeader.h>
18+
19+

AsyncDisplayKit-iOS/Info.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>com.facebook.$(PRODUCT_NAME:rfc1034identifier)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>NSPrincipalClass</key>
24+
<string></string>
25+
</dict>
26+
</plist>

AsyncDisplayKit.podspec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'AsyncDisplayKit'
3-
spec.version = '1.1.1'
3+
spec.version = '1.2.2'
44
spec.license = { :type => 'BSD' }
55
spec.homepage = 'http://asyncdisplaykit.org'
6-
spec.authors = { 'Ryan Nystrom' => 'rnystrom@fb.com', 'Scott Goodson' => 'scottg@fb.com' }
6+
spec.authors = { 'Scott Goodson' => 'scottgoodson@gmail.com', 'Ryan Nystrom' => 'rnystrom@fb.com' }
77
spec.summary = 'Smooth asynchronous user interfaces for iOS apps.'
8-
spec.source = { :git => 'https://github.com/facebook/AsyncDisplayKit.git', :tag => '1.1.1' }
8+
spec.source = { :git => 'https://github.com/facebook/AsyncDisplayKit.git', :tag => '1.2.2' }
99

1010
spec.documentation_url = 'http://asyncdisplaykit.org/appledoc/'
1111

1212
spec.public_header_files = [
1313
'AsyncDisplayKit/*.h',
1414
'AsyncDisplayKit/Details/**/*.h',
15+
'AsyncDisplayKit/Layout/*.h',
1516
'Base/*.h'
1617
]
1718

@@ -25,7 +26,10 @@ Pod::Spec.new do |spec|
2526

2627
# ASDealloc2MainObject must be compiled with MRR
2728
spec.requires_arc = true
28-
spec.exclude_files = ['AsyncDisplayKit/Details/ASDealloc2MainObject.m']
29+
spec.exclude_files = [
30+
'AsyncDisplayKit/Details/ASDealloc2MainObject.h',
31+
'AsyncDisplayKit/Details/ASDealloc2MainObject.m',
32+
]
2933
spec.subspec 'ASDealloc2MainObject' do |mrr|
3034
mrr.requires_arc = false
3135
mrr.source_files = [

AsyncDisplayKit.xcodeproj/project.pbxproj

Lines changed: 612 additions & 10 deletions
Large diffs are not rendered by default.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0630"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "2C5B669C1B3A796F005926A7"
18+
BuildableName = "AsyncDisplayKit.framework"
19+
BlueprintName = "AsyncDisplayKit-iOS"
20+
ReferencedContainer = "container:AsyncDisplayKit.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28+
shouldUseLaunchSchemeArgsEnv = "YES"
29+
buildConfiguration = "Debug">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36+
launchStyle = "0"
37+
useCustomWorkingDirectory = "NO"
38+
buildConfiguration = "Debug"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
allowLocationSimulation = "YES">
42+
<MacroExpansion>
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "2C5B669C1B3A796F005926A7"
46+
BuildableName = "AsyncDisplayKit.framework"
47+
BlueprintName = "AsyncDisplayKit-iOS"
48+
ReferencedContainer = "container:AsyncDisplayKit.xcodeproj">
49+
</BuildableReference>
50+
</MacroExpansion>
51+
<AdditionalOptions>
52+
</AdditionalOptions>
53+
</LaunchAction>
54+
<ProfileAction
55+
shouldUseLaunchSchemeArgsEnv = "YES"
56+
savedToolIdentifier = ""
57+
useCustomWorkingDirectory = "NO"
58+
buildConfiguration = "Release"
59+
debugDocumentVersioning = "YES">
60+
<MacroExpansion>
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "2C5B669C1B3A796F005926A7"
64+
BuildableName = "AsyncDisplayKit.framework"
65+
BlueprintName = "AsyncDisplayKit-iOS"
66+
ReferencedContainer = "container:AsyncDisplayKit.xcodeproj">
67+
</BuildableReference>
68+
</MacroExpansion>
69+
</ProfileAction>
70+
<AnalyzeAction
71+
buildConfiguration = "Debug">
72+
</AnalyzeAction>
73+
<ArchiveAction
74+
buildConfiguration = "Release"
75+
revealArchiveInOrganizer = "YES">
76+
</ArchiveAction>
77+
</Scheme>

AsyncDisplayKit/ASCellNode.m

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
1313
#import <AsyncDisplayKit/ASTextNode.h>
1414

15+
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
1516

1617
#pragma mark -
1718
#pragma mark ASCellNode
@@ -25,6 +26,7 @@ - (instancetype)init
2526

2627
// use UITableViewCell defaults
2728
_selectionStyle = UITableViewCellSelectionStyleDefault;
29+
self.clipsToBounds = YES;
2830

2931
return self;
3032
}
@@ -91,8 +93,6 @@ @interface ASTextCellNode () {
9193

9294
@implementation ASTextCellNode
9395

94-
static const CGFloat kHorizontalPadding = 15.0f;
95-
static const CGFloat kVerticalPadding = 11.0f;
9696
static const CGFloat kFontSize = 18.0f;
9797

9898
- (instancetype)init
@@ -106,19 +106,12 @@ - (instancetype)init
106106
return self;
107107
}
108108

109-
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
109+
- (id<ASLayoutable>)layoutSpecThatFits:(ASSizeRange)constrainedSize
110110
{
111-
CGSize availableSize = CGSizeMake(constrainedSize.width - 2 * kHorizontalPadding,
112-
constrainedSize.height - 2 * kVerticalPadding);
113-
CGSize textNodeSize = [_textNode measure:availableSize];
114-
115-
return CGSizeMake(ceilf(2 * kHorizontalPadding + textNodeSize.width),
116-
ceilf(2 * kVerticalPadding + textNodeSize.height));
117-
}
118-
119-
- (void)layout
120-
{
121-
_textNode.frame = CGRectInset(self.bounds, kHorizontalPadding, kVerticalPadding);
111+
static const CGFloat kHorizontalPadding = 15.0f;
112+
static const CGFloat kVerticalPadding = 11.0f;
113+
UIEdgeInsets insets = UIEdgeInsetsMake(kVerticalPadding, kHorizontalPadding, kVerticalPadding, kHorizontalPadding);
114+
return [ASInsetLayoutSpec newWithInsets:insets child:_textNode];
122115
}
123116

124117
- (void)setText:(NSString *)text
@@ -130,7 +123,7 @@ - (void)setText:(NSString *)text
130123
_textNode.attributedString = [[NSAttributedString alloc] initWithString:_text
131124
attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:kFontSize]}];
132125

133-
[self invalidateCalculatedSize];
126+
[self invalidateCalculatedLayout];
134127
}
135128

136129
@end

AsyncDisplayKit/ASCollectionView.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@
7070
*/
7171
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
7272

73+
/**
74+
* Reload everything from scratch, destroying the working range and all cached nodes.
75+
*
76+
* @param completion block to run on completion of asynchronous loading or nil. If supplied, the block is run on
77+
* the main thread.
78+
* @warning This method is substantially more expensive than UICollectionView's version.
79+
*/
80+
- (void)reloadDataWithCompletion:(void (^)())completion;
81+
7382
/**
7483
* Reload everything from scratch, destroying the working range and all cached nodes.
7584
*
@@ -122,6 +131,20 @@
122131
*/
123132
- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath;
124133

134+
/**
135+
* Determines collection view's current scroll direction. Supports 2-axis collection views.
136+
*
137+
* @returns a bitmask of ASScrollDirection values.
138+
*/
139+
- (ASScrollDirection)scrollDirection;
140+
141+
/**
142+
* Determines collection view's scrollable directions.
143+
*
144+
* @returns a bitmask of ASScrollDirection values.
145+
*/
146+
- (ASScrollDirection)scrollableDirections;
147+
125148
@end
126149

127150

0 commit comments

Comments
 (0)