Database Reference
In-Depth Information
Now drag a UICollectionView from the object library to your storyboard.
4.
With the new UICollectionView selected, embed a UINavigationController
by selecting Editor ➤ Embed In ➤ Navigation Controller from the Xcode menu.
5.
Ctrl-drag from the Tab Bar Controller to the new UINavigationController
and select View Controllers under Relationship Segue from the pop-up menu.
6.
Select the Tab Bar Item in the new UINavigationController and change the
title to Friends .
7.
Now select the Tab Bar Item inside MainViewController and change the title
to Me .
8.
Now drag a UIViewController from the object library and place it to the right
of the Collection View Controller.
9.
Ctrl-drag from the UICollectionViewController to the new UIViewController
and select push from the pop-up menu.
10.
Configuring the Collection View Controller
Now we need to configure the collection view controller:
1.
Select the Collection View inside the UICollectionView controller.
2.
In the Attribute Inspector, change the Background color of the view to
White Color.
3.
Select the Size Inspector and change the Cell Size to width:140 and
height:177.
4.
Change the section insets to top:8 bottom:8 left:8 right:8.
5.
Drag a Bar Button Item to the top right of the navigation bar and change its
identifier to Add.
6.
Now drag a UIImageView from the object library into the
UICollectionViewCell .
7.
Give the Image View a width and height of 140.
Drag a UILabel from the object library into the UICollectionViewCell .
8.
9.
Position it at x:0 y:148 width:140 height:21.
10.
Select the Attribute Inspector and change the alignment to centered.
11.
Set autoshrink to Minimum Font Scale and give it a value of 0.5.
12.
Select the Navigation Item and set the title to Friends .
 
Search WWH ::




Custom Search