János János - 1 year ago 109
iOS Question

20px gap between collection view and its container

I can see a 20px gap between collection view and its container and I do not know why. I set all constraints to stretch view the full container. Any idea?

enter image description here

Answer Source

For UICollectionViewController it is important to set view's frame after transition. In somehow UITableViewController set itself automatically.

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

        let src = segue.sourceViewController as UIViewController
        let dst = segue.destinationViewController as UIViewController

        dst.view.frame = self.view.bounds //<-- this line is important for collection view
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download