You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When this plugin registered inherited cell, it does dequeueReusableCell as its supperclass.
In this case, it will occur crash because registered class and dequeued class is different.
classBaseCell:UICollectionViewCell,Reusable{}classMyCell:BaseCell{}letcellType:BaseCell.Type=MyCell.self
classCollectionViewController:UICollectionViewController{overridefunc viewDidLoad(){
// it is registered as "BaseCell". But I think this cell should be registered as "MyCell".
collectionView.registerReusableCell(cellType)}overridefunc collectionView(collectionView:UICollectionView,
cellForItemAtIndexPath indexPath:NSIndexPath)->UICollectionViewCell{
// in this statement, the cell is "MyCell". (will be crashed)
letcell= collectionView.dequeueReusableCell(indexPath: indexPath, cellType: cellType)return cell
}
// ...
}
If possible, I will send a pull-request. :)
Thanks.
The text was updated successfully, but these errors were encountered:
narirou
changed the title
behavior when inherited class
inherited class behavior
Feb 29, 2016
Hi.
When this plugin registered inherited cell, it does
dequeueReusableCell
as its supperclass.In this case, it will occur crash because registered class and dequeued class is different.
If possible, I will send a pull-request. :)
Thanks.
The text was updated successfully, but these errors were encountered: