Adding caption label to UImageView in Collection View
<p>I am completely new to iOS development. I have never wrote a piece of code in my life. But I am attempting to follow this tutorial <a href="http://swiftiostutorials.com/tutorial-using-uicollectionview-uicollectionviewflowlayout/" rel="nofollow">here</a>. I have successfully completed the tutorial, but I am looking to mod the code a little bit. </p>

<ul>
<li>How can I add a text 'Title' under each Image loaded?</li>
<li>And also how do i go about changing the colors of the image border
and app background?</li>
</ul>

<p><strong>ViewController</strong>:</p>

<pre><code>import UIKit

class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {

    @IBOutlet var collectionView: UICollectionView!

    var galleryItems: [GalleryItem] = []
    var listOfDescriptions = [String]()

    // MARK: -
    // MARK: - View Lifecycle

    override func viewDidLoad() {
        super.viewDidLoad()
        initGalleryItems()
        collectionView.reloadData()
        let value = UIInterfaceOrientation.LandscapeLeft.rawValue
        UIDevice.currentDevice().setValue(value, forKey: "orientation")
    }

    private func initGalleryItems() {

        var items = [GalleryItem]()
        let inputFile = NSBundle.mainBundle().pathForResource("items", ofType: "plist")

        let inputDataArray = NSArray(contentsOfFile: inputFile!)

        for inputItem in inputDataArray as! [Dictionary&lt;String, String&gt;] {
            let galleryItem = GalleryItem(dataDictionary: inputItem)
            items.append(galleryItem)
        }

        galleryItems = items
    }
    private func populateList() {
        listOfDescriptions.append("Valhaha is a flavor");
        listOfDescriptions.append("Unicorns blood is made from dead unicorns. Harry Potter in this bit");
    }
    private func getDescription(position: Int) -&gt; String {
        return listOfDescriptions[position]
    }

    // MARK: -
    // MARK: - UICollectionViewDataSource

    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
        return galleryItems.count
    }

    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {

        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("GalleryItemCollectionViewCell", forIndexPath: indexPath) as! GalleryItemCollectionViewCell

        cell.setGalleryItem(galleryItems[indexPath.row])
        return cell

    }

    func numberOfSectionsInCollectionView(collectionView: UICollectionView) -&gt; Int {
        return 1
    }

    func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -&gt; UICollectionReusableView {

        let commentView = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: "GalleryItemCommentView", forIndexPath: indexPath) as! GalleryItemCommentView

        commentView.commentLabel.text = "Supplementary view of kind \(kind)"

        return commentView
    }

    // MARK: -
    // MARK: - UICollectionViewDelegate

    func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {

        let alert = UIAlertController(title: "didSelectItemAtIndexPath:", message: "Indexpath = \(indexPath)", preferredStyle: .Alert)

        let alertAction = UIAlertAction(title: "Dismiss", style: .Destructive, handler: nil)
        alert.addAction(alertAction)

        self.presentViewController(alert, animated: true, completion: nil)
    }

    // MARK: -
    // MARK: - UICollectionViewFlowLayout

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&gt; CGSize {
        let picDimension = self.view.frame.size.width / 4.0
        return CGSizeMake(picDimension, picDimension)
    }

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -&gt; UIEdgeInsets {
        let leftRightInset = self.view.frame.size.width / 14.0
        return UIEdgeInsetsMake(0, leftRightInset, 0, leftRightInset)
    }
}
</code></pre>

<p><strong>GalleryItemCollectionCellView</strong>:</p>

<pre><code>import UIKit

class GalleryItemCollectionViewCell: UICollectionViewCell {

@IBOutlet var itemImageView: UIImageView!

func setGalleryItem(item:GalleryItem) {
    itemImageView.image = UIImage(named: item.itemImage)
}
</code></pre>

<p>}</p>