Latest 0.1.0
Homepage https://github.com/dave-pang/TagStyledView
License MIT
Platforms ios 11.0
Authors

CI Status
Version
License
Platform

Example

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

TagStyledView

Requirements

Installation

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

pod 'TagStyledView'

Usage

Setup in Interface Builder

  1. In the Identity Inspector, set the layout object’s custom class to TagStyledView.

    TagStyledView

    @IBOutlet weak var tagStyledView: TagStyledView!
  2. Register a nib file for use in creating new collection view cells.

    class TagCell1: UICollectionViewCell, TagStyling {
        @IBOutlet weak var tagLabel: UILabel!
    }
    
    class TagCell2: UICollectionViewCell, TagStyling {
        @IBOutlet weak var tagLabel: UILabel!
    }
    
    class TagCell3: UICollectionViewCell, TagStyling {
        @IBOutlet weak var tagLabel: UILabel!
    }
    tagStyledView.register(UINib(nibName: TagCell1.Resource.identifier, bundle: nil), forCellWithReuseIdentifier: TagCell1.Resource.identifier)
    tagStyledView.register(UINib(nibName: TagCell2.Resource.identifier, bundle: nil), forCellWithReuseIdentifier: TagCell2.Resource.identifier)
    tagStyledView.register(UINib(nibName: TagCell3.Resource.identifier, bundle: nil), forCellWithReuseIdentifier: TagCell3.Resource.identifier)

    💡 Pro Tip: You must implement the TagStyling protocol.

    Setup in code

  3. Set tags data.

    tagStyledView.tags = ["first", "second", "third", "fourth fourth fourth fourth fourth fourth fourth", "fifth"]
  4. Customize TagStyledView.Options

    let options = TagStyledView.Options(sectionInset: .zero,
                                            lineSpacing: 10.0,
                                            interitemSpacing: 10.0,
                                            align: TagStyledView.Options.Alignment.left)
    tagStyledView.options = options
  5. Run the app.

Enjoy! 😎

Author

dave.pang, [email protected]

License

TagStyledView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "TagStyledView",
    "version": "0.1.0",
    "summary": "TagStyledView Class",
    "description": "Easier view of the style of the tag view View to receive and display cells of the collection view",
    "homepage": "https://github.com/dave-pang/TagStyledView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "dave.pang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dave-pang/TagStyledView.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "11.0"
    },
    "swift_version": "4.2",
    "source_files": "TagStyledView/Classes/**/*"
}

Pin It on Pinterest

Share This