KWCollectionView
public class KWCollectionView : UIViewController
extension KWCollectionView: UICollectionViewDataSource
extension KWCollectionView: UICollectionViewDelegate
extension KWCollectionView: KeywordCellLayoutDelegate
This collection view is a container that displays and manages keywords
-
The font of the label inside the keyword (default: system bold of size 14)
Declaration
Swift
public var customFont: UIFont -
The inset between every keyword (default: 10 points)
Declaration
Swift
public var customSpacing: CGFloat -
The corner radius of the keyword view (default: 14 points)
Declaration
Swift
public var customCornerRadius: CGFloat -
The background color of the keyword view
Declaration
Swift
public var customBackgroundColor: UIColor -
The color of the keyword cell border, if present
Declaration
Swift
public var customTagBorderColor: UIColor? -
The border of the keyword cell view
Declaration
Swift
public var customTagBorderWidth: CGFloat? -
The action embedded in the keyword: add, remove or no action (default: no action). (this changes the embedded icon)
Declaration
Swift
public var action: ActionType
-
The actual collectionView inside the controller, where every cell is a keyword
Declaration
Swift
public var keywordsCollectionView: UICollectionView! -
The custom cell layout of the single cell
Declaration
Swift
public var keywordCellLayout: KeywordCellLayout! -
If keywords in the collection are given an action of type “add”, a receiver can be automatically binded on this property
Declaration
Swift
public var receiver: KWCollectionView? -
A controller that confromed to be a delegate for the keywords collection view
Declaration
Swift
public var delegate: KWCollectionViewDelegate? -
The array containing all the keywords of the collection
Declaration
Swift
public var keywords: [CMSCategory]
-
Declaration
Swift
public convenience init(keywords: [CMSCategory], action: ActionType, receiver: KWCollectionView?) -
Declaration
Swift
public override func viewDidLoad() -
Declaration
Swift
public override func viewDidLayoutSubviews() -
Adds a keyword to the keyword view
Declaration
Swift
public func addNewKeyword(named keyword: CMSCategory)Parameters
keywordthe name of the keyword to add
-
Removes a keyword from the keyword view
Declaration
Swift
public func removeOldKeyword(named keyword: CMSCategory)Parameters
keywordthe name of the keyword to remove
-
Declaration
Swift
public func numberOfSections(in collectionView: UICollectionView) -> Int -
Declaration
Swift
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int -
Declaration
Swift
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
-
Declaration
Swift
public func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath)
-
Declaration
Swift
public func keywordCellLayoutInteritemHorizontalSpacing(layout: KeywordCellLayout) -> CGFloat -
Declaration
Swift
public func keywordCellLayoutInteritemVerticalSpacing(layout: KeywordCellLayout) -> CGFloat -
Declaration
Swift
public func keywordCellLayoutTagSize(layout: KeywordCellLayout, atIndex index: Int) -> CGSize -
Declaration
Swift
public func textSize(text: String, font: UIFont, collectionView: UICollectionView) -> CGSize
-
Declaration
Swift
public func didTapButton(name: CMSCategory, action: ActionType)
KWCollectionView Class Reference