forked from PikPak-App/iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPictureCollectionViewController.swift
More file actions
45 lines (29 loc) · 1.28 KB
/
PictureCollectionViewController.swift
File metadata and controls
45 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// PictureCollectionViewController.swift
// Pik Pak
//
// Created by Arpan Rughani on 9/12/15.
// Copyright (c) 2015 Pik Pak. All rights reserved.
//
import UIKit
class PictureCollectionViewController: UICollectionViewController, UICollectionViewDataSource, UICollectionViewDelegate{
var imagesArray = [String]()
override func viewDidLoad() {
super.viewDidLoad()
imagesArray = ["Dom", "ivan", "zack"]
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
var cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! UICollectionViewCell
var imageView = cell.viewWithTag(1) as! UIImageView
imageView.image = UIImage(named: imagesArray[indexPath.row])
return cell
}
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int{
return imagesArray.count
}
}