Adding custom attribute to NSAttributedString on iOS

NSAttributedString is used for displaying rich text on Apple platforms. There are many attributes available for styling the text. Let's see how to add new attribute and how to draw it in UITextView. Drawing custom attribute Defining a new attribute is just a matter of extending NSAttributedString.Key and defining a new static variable. Difficult part …

Circle shaped collection view layout on iOS

UICollectionViewLayout's responsibility is to define layout: all the cell locations and sizes. It acts like a data source object which provides layout related information to the collection view. Collection view then uses that information for creating cells and placing them on screen. This time we'll take a look on how to create a custom circle …