O'Reilly logo

Mastering iOS 10 Programming by Donny Wals

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and implementing a custom UICollectionViewCell

When you implemented the UITableViewCell in the previous chapter, you designed a custom cell. This cell was a view that was reused by the UITableView for every contact in the contacts array. UICollectionView also uses cells but you can't use UITableViewCell in a UICollectionView. However, the two different cells do share some functionalities, such as the prepareForReuse method and the awakeFromNib method, we saw in the previous chapter.

When you replaced the table view with a collection view, you might have noticed that the collection view immediately contained a default cell. This cell is a lot more flexible than the table view cell was; you can resize both its width and its height.

If you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required