- Create a new Xcode project with our lovely template Single View template and name it Collection View.
- Open the storyboard file and select our lonely view controller and change its size to iPhone 4-inch.
- Select the View Controller, go to Editor | Embed In | UINavigationController to automatically make your view controller a root view controller of a navigation controller:
- From Object Library, drag the UICollectionView and add it as a subview. Change its frame to (X = 0, Y = 0, Width = 375, Height = 603).
- Add constraints to make your collection view always at the location (0, 0) and with the size same as that of the screen. ...
Get iOS Programming Cookbook now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.