Does anyone Know how to implement this design (in swift)?

82 views Asked by At

The profiles get pulled in from a server but I don't know how to implement this. Had been thinking about a dynamic table view, but I don't know if you can draw cells like that. The pictures have to be clickable.

enter image description here

3

There are 3 answers

2
nachshon f On BEST ANSWER

Add A UICollectionView to your screen. In the collection view cell, place a image view, then use this code to create the blue border and circle image...

    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

        let cell:UICollectionViewCell = self.collectionView.dequeueReusableCellWithReuseIdentifier("BasicCell", forIndexPath: indexPath) as UICollectionViewCell



        let imageView = cell.viewWithTag(1) as! UIImageView


       //border 
     imageView.layer.borderWidth = 2.0
        imageView.layer.borderColor = UIColor.blueColor().CGColor


//make imageView Circle

imageView.layer.cornerRadius = imageView.frame.size.width / 2
        imageView.clipsToBounds = true


        return cell
    }
0
lchamp On

UICollectionView is probably what you're looking for (to display like on your screen capture : sections / items).

UICollectionView Class Reference : https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/

It's similar as working with UITableView. Still, you might want to read some tutorials about it.

0
Josh Homann On

What you want is UICollectionView. Think of it as the generic version of UITableView.