ResizingTokenField is a token field implementation written in Swift 5.
Features:
- Can be used in Interface Builder or created programmatically
- Uses a UICollectionView to display tokens, allowing token changes to be animated
- Automatically updates intrinsic height as content is added and removed
- Supports collapsing tokens into a text description
- Allows providing a custom UICollectionViewCell for tokens
Usage
The token field can be used via Interface Builder – add an empty UIView to your layout and set its class to ResizingTokenField. It can also be initialized programmatically by using init(frame:).
Meant to be used with auto layout; it provides intrinsic content height, meaning you only need to pin its position and width, height will change automatically as content is added and removed from the field. In Interface Builder, the Placeholder Intrinsic Size setting can be used for height.
