How to create an image gallery in Xcode 7 Swift 2

0

Hi, I'm starting to use Xcode 7 with Swift 2, what I need is basically on a screen to display a gallery of images in which more 20 images should go. I was looking for how to achieve this and the only thing I found is that an image they divided it into 3 and made the transition by sectors of the image but that does not help me much since I will use many images for that. Any advice or help is appreciated.

    
asked by Nicolas Rudisky 13.05.2016 в 21:56
source

2 answers

0

As it says very well @Spidvmp that is the best solution. I leave you a tutorial of the steps you have to follow to do what you want. ( link ) greetings.

    
answered by 18.05.2016 / 08:27
source
0

If you use UICollectionView it will be the simplest, I'll give you an example of how to implement it

func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
        return 1
    }

    //2
    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 12 //numero de imágenes
    }

    //3
    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        //Esto se utiliza para hacer uso de celdas personalizadas
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! Viewcontroller 

        cell.imagen.image = imagen que toque 
        return cell
    }

}

    
answered by 18.05.2016 в 15:24