startManagingWithDelegate crash
Mustafa-Ezzat opened this issue · 1 comments
class: DTCollectionViewManager.swift
method: open func startManaging(withDelegate delegate : DTCollectionViewManageable)
line 204: guard let collectionView = delegate.collectionView ?? delegate.optionalCollectionView else {
preconditionFailure("Call startManagingWithDelegate: method only when UICollectionView has been created")
}
DTCollectionViewManager/DTCollectionViewManager.swift:204: Fatal error: Call startManagingWithDelegate: method only when UICollectionView has been created
2021-07-04 19:12:51.399824+0200 Doctorate[2073:95370] DTCollectionViewManager/DTCollectionViewManager.swift:204: Fatal error: Call startManagingWithDelegate: method only when UICollectionView has been created
Hi!
As written in this precondition, calling this method is only supported when view is loaded(particularly collectionView
property). Good place to call this method is in viewDidLoad
view controller method or whenever you can make sure collectionView
or optionalCollectionView
property is not nil.