@@ -22,7 +22,7 @@ nextPage: containers-aspagernode.html
22
22
</pre >
23
23
24
24
<pre lang =" swift " class = " swiftCode hidden " >
25
- override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath ) -> UICollectionViewCell
25
+ override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath ) -> UICollectionViewCell
26
26
</pre >
27
27
</div >
28
28
</div >
@@ -37,7 +37,7 @@ with your choice of **_one_** of the following methods
37
37
- (ASCellNode *)collectionNode:(ASCollectionNode *)collectionNode nodeForItemAtIndexPath:(NSIndexPath *)indexPath
38
38
</pre >
39
39
<pre lang =" swift " class = " swiftCode hidden " >
40
- override func collectionNode(collectionNode: ASCollectionNode, nodeForItemAtIndexPath indexPath: NSIndexPath ) -> ASCellNode
40
+ override func collectionNode(_ collectionNode: ASCollectionNode, nodeForItemAt indexPath: IndexPath ) -> ASCellNode
41
41
</pre >
42
42
</div >
43
43
</div >
54
54
- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
55
55
</pre >
56
56
<pre lang =" swift " class = " swiftCode hidden " >
57
- override func collectionNode(collectionNode: ASCollectionNode, nodeBlockForItemAtIndexPath indexPath: NSIndexPath ) -> ASCellNodeBlock
57
+ override func collectionNode(_ collectionNode: ASCollectionNode, nodeBlockForItemAt indexPath: IndexPath ) -> ASCellNodeBlock
58
58
</pre >
59
59
</div >
60
60
</div >
@@ -96,7 +96,7 @@ Consider the following `-collectionNode:nodeBlockForItemAtIndexPath:` method.
96
96
</pre >
97
97
98
98
<pre lang =" swift " class = " swiftCode hidden " >
99
- func tableNode (_ collectionNode: ASCollectionNode, nodeBlockForItemAt indexPath: IndexPath) -> ASCellNodeBlock {
99
+ func collectionNode (_ collectionNode: ASCollectionNode, nodeBlockForItemAt indexPath: IndexPath) -> ASCellNodeBlock {
100
100
guard photoFeed.count > indexPath.row else { return { ASCellNode() } }
101
101
102
102
let photoModel = photoFeed[indexPath.row]
@@ -130,13 +130,13 @@ An ASCollectionNode is assigned to be managed by an `ASViewController` in its `-
130
130
<pre lang =" objc " class =" objcCode " >
131
131
- (instancetype)init
132
132
{
133
- _flowLayout = [[UICollectionViewFlowLayout alloc] init];
133
+ _flowLayout = [[UICollectionViewFlowLayout alloc] init];
134
134
_collectionNode = [[ASCollectionNode alloc] initWithCollectionViewLayout:_flowLayout];
135
135
136
136
self = [super initWithNode:_collectionNode];
137
137
if (self) {
138
- _flowLayout.minimumInteritemSpacing = 1;
139
- _flowLayout.minimumLineSpacing = 1;
138
+ _flowLayout.minimumInteritemSpacing = 1;
139
+ _flowLayout.minimumLineSpacing = 1;
140
140
}
141
141
142
142
return self;
@@ -145,13 +145,13 @@ An ASCollectionNode is assigned to be managed by an `ASViewController` in its `-
145
145
146
146
<pre lang =" swift " class = " swiftCode hidden " >
147
147
init() {
148
- flowLayout = UICollectionViewFlowLayout()
148
+ flowLayout = UICollectionViewFlowLayout()
149
149
collectionNode = ASCollectionNode(collectionViewLayout: flowLayout)
150
150
151
151
super.init(node: collectionNode)
152
152
153
- flowLayout.minimumInteritemSpacing = 1
154
- flowLayout.minimumLineSpacing = 1
153
+ flowLayout.minimumInteritemSpacing = 1
154
+ flowLayout.minimumLineSpacing = 1
155
155
}
156
156
</pre >
157
157
</div >
@@ -178,7 +178,7 @@ The `LocationCollectionNodeController` above accesses the `ASCollectionView` dir
178
178
{
179
179
[super viewDidLoad];
180
180
181
- _collectionNode.delegate = self;
181
+ _collectionNode.delegate = self;
182
182
_collectionNode.dataSource = self;
183
183
_collectionNode.view.allowsSelection = NO;
184
184
_collectionNode.view.backgroundColor = [UIColor whiteColor];
@@ -189,10 +189,10 @@ The `LocationCollectionNodeController` above accesses the `ASCollectionView` dir
189
189
override func viewDidLoad() {
190
190
super.viewDidLoad()
191
191
192
- collectionNode.delegate = self
192
+ collectionNode.delegate = self
193
193
collectionNode.dataSource = self
194
194
collectionNode.view.allowsSelection = false
195
- collectionNode.view.backgroundColor = UIColor.whiteColor()
195
+ collectionNode.view.backgroundColor = .white
196
196
}
197
197
</pre >
198
198
</div >
0 commit comments