Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ open class ASCollectionSectionedDataSource<S: SectionModelType>: NSObject, ASCol
}

fileprivate static func configureCellBlockNotSet(dataSource: ASCollectionSectionedDataSource<S>, node: ASCollectionNode, indexPath: IndexPath, model: I) -> ASCellNodeBlock {
return { dataSource.collectionNode(node, nodeForItemAt: indexPath) }
// Users expect collectionNode(_:nodeForItemAt:) will be executed in main thread
let cellNode = dataSource.collectionNode(node, nodeForItemAt: indexPath)
return { cellNode }
}

fileprivate static func configureSupplementaryViewBlockNotSet(dataSource: ASCollectionSectionedDataSource<S>, node: ASCollectionNode, nodeForSupplementaryElementOfKind kind: String, indexPath: IndexPath) -> ASCellNodeBlock {
return { dataSource.collectionNode(node, nodeForSupplementaryElementOfKind: kind, at: indexPath) }
// Users expect collectionNode(_nodeForSupplementaryElementOfKind:at:) will be executed in main thread according to api doc.
return { DispatchQueue.main.sync(execute: { dataSource.collectionNode(node, nodeForSupplementaryElementOfKind: kind, at: indexPath) }) }
}

public init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ open class ASTableSectionedDataSource<S: SectionModelType>: NSObject, ASTableDat
}

fileprivate static func configureCellBlockNotSet(dataSource: ASTableSectionedDataSource<S>, node: ASTableNode, indexPath: IndexPath, model: I) -> ASCellNodeBlock {
return { dataSource.tableNode(node, nodeForRowAt: indexPath) }
// Users expect taleNode(_:nodeForRowAt:) will be executed in main thread
let cellNode = dataSource.tableNode(node, nodeForRowAt: indexPath)
return { cellNode }
}

#if os(iOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ open class RxASTableAnimatedDataSource<S: AnimatableSectionModelType>: ASTableSe
tableNode.reloadData()
}
}
}.on(observedEvent)
}.on(observedEvent)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ open class RxASTableReloadDataSource<S: SectionModelType>: ASTableSectionedDataS
dataSource.setSections(element)
tableNode.reloadData()
}
}.on(observedEvent)
}.on(observedEvent)
}
}