Xiaoye220/EmptyDataSet-Swift

Layout not completed when setting datasource for customView

SwiftRabbit opened this issue · 1 comments

Quite often, when I return a customView from the datasource, the layout of the collectionView/tableView is not completed.

Very often I have have to set the emptyDataSetSource asynchronously on the main thread to avoid a UI glitch (teleportation of the bottom constraint) if I set the emptyDataSource in the viewDidLoad().
The other alternative I have is to set it in the viewDidLayoutSubviews()

Would there be a way to improve this?

Is there any code or screenshot? The layout of customview is determined by frame instead of autolayout.