Skip to content

Commit 5763d8f

Browse files
committed
catch PatrickChow's comment
1 parent 17391c4 commit 5763d8f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Sources/DataSources/ASCollectionNode+Rx/ASCollectionSectionedDataSource.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ open class ASCollectionSectionedDataSource<S: SectionModelType>: NSObject, ASCol
2929
}
3030

3131
fileprivate static func configureCellBlockNotSet(dataSource: ASCollectionSectionedDataSource<S>, node: ASCollectionNode, indexPath: IndexPath, model: I) -> ASCellNodeBlock {
32-
// Users expect collectionNode(_:nodeForItemAt:) will be executed in main thread according to api doc (http://texturegroup.org/appledoc/Protocols/ASCollectionDataSource.html#//api/name/collectionView:nodeForItemAtIndexPath:).
33-
return { DispatchQueue.main.sync(execute: { dataSource.collectionNode(node, nodeForItemAt: indexPath) }) }
32+
// Users expect collectionNode(_:nodeForItemAt:) will be executed in main thread
33+
let cellNode = dataSource.collectionNode(node, nodeForItemAt: indexPath)
34+
return { cellNode }
3435
}
3536

3637
fileprivate static func configureSupplementaryViewBlockNotSet(dataSource: ASCollectionSectionedDataSource<S>, node: ASCollectionNode, nodeForSupplementaryElementOfKind kind: String, indexPath: IndexPath) -> ASCellNodeBlock {

Sources/DataSources/ASTableNode+Rx/ASTableSectionedDataSource.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ open class ASTableSectionedDataSource<S: SectionModelType>: NSObject, ASTableDat
3535
}
3636

3737
fileprivate static func configureCellBlockNotSet(dataSource: ASTableSectionedDataSource<S>, node: ASTableNode, indexPath: IndexPath, model: I) -> ASCellNodeBlock {
38-
// Users expect taleNode(_:nodeForRowAt:) will be executed in main thread according to api doc http://texturegroup.org/appledoc/Protocols/ASTableDataSource.html#//api/name/tableNode:nodeForRowAtIndexPath: .
39-
return { DispatchQueue.main.sync(execute: { dataSource.tableNode(node, nodeForRowAt: indexPath) }) }
38+
// Users expect taleNode(_:nodeForRowAt:) will be executed in main thread
39+
let cellNode = dataSource.tableNode(node, nodeForRowAt: indexPath)
40+
return { cellNode }
4041
}
4142

4243
#if os(iOS)

0 commit comments

Comments
 (0)