Reputation: 3483
What does optional func myFunction() { .. }
mean in the Apple API docs; for example this entry for UICollectionViewDelegate :
optional func collectionView(_ collectionView: UICollectionView,
didSelectItemAtIndexPath indexPath: NSIndexPath)
Upvotes: 1
Views: 232
Reputation: 3483
It means that classes adopting this protocol are not required to implement those methods in order to be conformant. Although not implementing any of these methods will not make for a good data source.
Upvotes: 3