Latest 0.2.0
Homepage https://github.com/nekonora/TaggerKit
License MIT
Platforms ios 12.0
Frameworks UIKit
Authors

Version
License
Platform

TaggerKit helps you quickly integrate tags into your iOS projects. It provides a collection view for displaying tags and a text field for adding them to another collection view. The custom layout used by TaggerKit is based on TagCellLayout by Ritesh Gupta.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

TaggerKit runs on Swift 4.2 and iOS 12.

Installation

TaggerKit is available through CocoaPods. To install
it, just add the following line to your Podfile:

pod 'TaggerKit'

Setup

Static tags

Tags can be implemented in a couple of ways. Let’s start simple: you have a bunch of tags (Strings) that you want to show to the user. A static collection view is just what we need.

  1. In Interface Builder, create a container view in your ViewController and then delete its child from the storyboard:

Interface Builder container view

  1. Import TaggerKit into your view controller and create an outlet for the container view

    import TaggerKit
    
        class ViewController: UIViewController {
    
            @IBOutlet var containerView: UIView!
    
  2. Instantiate and a TKCollectionView() and give it to the container with:

    var tagCollection: TKCollectionView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
    
        add(tagCollection, toView: containerView)
  3. Give the collection view some tags:

        tagCollection.tags = ["Some", "Tag", "For", "You"]
  4. Done!

Dynamic tags

Coming soon (really soon)!

Customisation

TKCollectionView has some properties you can set to modify the tag’s appearance:

// Custom font
    tagCollection.customFont = UIFont.boldSystemFont(ofSize: 14)
// Corner radius of tags    
    tagCollection.customCornerRadius = 14.0     
// Spacing between cells                    
    tagCollection.customSpacing = 20.0  
// Background of cells                      
    tagCollection.customBackgroundColor = UIColor.red   

Latest podspec

{
    "name": "TaggerKit",
    "version": "0.2.0",
    "summary": "TaggerKit is a straightforward library that helps you implement tags in your iOS project.",
    "description": "This library helps you to quickly implement tags in your iOS apps, so you can go on and test your idea without having to worry about logic and custom collection layouts.",
    "homepage": "https://github.com/nekonora/TaggerKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nekonora/TaggerKit.git",
        "tag": "0.2.0"
    },
    "social_media_url": "https://twitter.com/_nknr",
    "platforms": {
        "ios": "12.0"
    },
    "source_files": "TaggerKit/Classes/**/*",
    "resource_bundles": {
        "TaggerKit": [
            "TaggerKit/Assets/*.png"
        ]
    },
    "resources": "TaggerKit/Assets/**/*.{png,storyboard}",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This