ios - How to get the size of a UICollectionView cell before rotation -


i have uicollectionview has width percentage of it's parent. when rotates need know size going be, can invalidate layout , redraw collection view cells new full width. using viewwilltransitiontosize:withtransitioncoordinator: method, size returns of entire screen. there easy way new frame of uicollectionview before orientation change takes effect?

    override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) {           super.viewwilltransitiontosize(size, withtransitioncoordinator: coordinator)             print(self.collectionview.frame) // old frame           coordinator.animatealongsidetransition({ (uiviewcontrollertransitioncoordinatorcontext) -> void in             }) { (uiviewcontrollertransitioncoordinatorcontext) -> void in               print(self.collectionview.frame) // new frame            }       } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -