All Projects → nekonora → Taggerkit

nekonora / Taggerkit

Licence: mit
🏷 TaggerKit helps you to quickly implement tags in your UIKit apps, so you can go on and test your idea without having to worry about logic and custom collection layouts.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Taggerkit

Wstagsfield
An iOS text field that represents tags, hashtags, tokens in general.
Stars: ✭ 1,013 (+159.74%)
Mutual labels:  cocoapods, carthage, tags
Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (-17.44%)
Mutual labels:  cocoapods, carthage
Gzipswift
Swift framework that enables gzip/gunzip Data using zlib
Stars: ✭ 356 (-8.72%)
Mutual labels:  cocoapods, carthage
Circularprogress
Circular progress indicator for your macOS app
Stars: ✭ 366 (-6.15%)
Mutual labels:  cocoapods, carthage
Foldingtabbar.ios
Folding Tab Bar and Tab Bar Controller
Stars: ✭ 3,677 (+842.82%)
Mutual labels:  cocoapods, carthage
Serrata
Slide image viewer library similar to Twitter and LINE.
Stars: ✭ 322 (-17.44%)
Mutual labels:  cocoapods, carthage
Tbuiautotest
Generating UI test label automatically for iOS.
Stars: ✭ 333 (-14.62%)
Mutual labels:  cocoapods, carthage
Eachnavigationbar
A custom navigation bar for each view controller.
Stars: ✭ 314 (-19.49%)
Mutual labels:  cocoapods, carthage
Sclalertview
Beautiful animated Alert View. Written in Objective-C
Stars: ✭ 3,426 (+778.46%)
Mutual labels:  cocoapods, carthage
Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+851.28%)
Mutual labels:  cocoapods, carthage
Pagecontroller
Infinite paging controller, scrolling through contents and title bar scrolls with a delay
Stars: ✭ 344 (-11.79%)
Mutual labels:  cocoapods, carthage
Fwplayer
A video player SDK for iOS, it is based on AVPlayer. https://se.linkedin.com/in/foks-huiwang, https://fokswang.wixsite.com/home
Stars: ✭ 321 (-17.69%)
Mutual labels:  cocoapods, carthage
Microfeatures Guidelines
📦📝 uFeatures guidelines
Stars: ✭ 315 (-19.23%)
Mutual labels:  cocoapods, carthage
Ssspinnerbutton
Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a diffrent spinner animations.
Stars: ✭ 357 (-8.46%)
Mutual labels:  cocoapods, carthage
Misterfusion
MisterFusion is Swift DSL for AutoLayout. It is the extremely clear, but concise syntax, in addition, can be used in both Swift and Objective-C. Support Safe Area and Size Class.
Stars: ✭ 314 (-19.49%)
Mutual labels:  cocoapods, carthage
Rxappstate
RxSwift extensions for UIApplicationDelegate methods to observe changes in your app's state
Stars: ✭ 328 (-15.9%)
Mutual labels:  cocoapods, carthage
Vgplayer
📺 A simple iOS video player by Vein.
Stars: ✭ 383 (-1.79%)
Mutual labels:  cocoapods, carthage
Xlactioncontroller
Fully customizable and extensible action sheet controller written in Swift
Stars: ✭ 3,228 (+727.69%)
Mutual labels:  cocoapods, carthage
Ioniconskit
Use Ionicons in your Swift projects.
Stars: ✭ 310 (-20.51%)
Mutual labels:  cocoapods, carthage
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (+770.51%)
Mutual labels:  cocoapods, carthage

TaggerKit

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 is writtern is compatible with Swift 4.2/5 and runs on iOS 11+.

Changelog

0.6.1

• Added support for Swift Package Manager; • Fixed a bug that was causing a tag view to not send tags to another one by tapping the button; • Added a convenience init method to create a tag view more quickly;

0.6

tagIsBeingAdded and tagIsBeingRemoved methods are not accessible by override from UIViewControllers. This is because UIViewController is not a delegate of TKViewController anymore. If you want to use these methods you can still make your controller conform to the TKCollectionViewDelegate protocol; • Custom properties customTagBorderWidth and customTagBorderColor can now be set; • Added Carthage support; • iOS 13, Xcode 11, Swift 5.1 support; • Some code refactored;

Installation

TaggerKit is available through CocoaPods, Carthage or SPM.

To install the latest version, just add the following line to your Podfile:

pod 'TaggerKit'

In your Cartfile:

github "nekonora/TaggerKit" ~> 0.6.0

Or add this repo as a swift package inside of Xcode 11.

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

Do this if you want what you saw in the preview GIF.

  1. Follow the instructions above and create two collection views, putting them into two different containers

  2. For both collection views set their .action property accordingly. For example: if you are in a view displaying a product to which your user has already added some tags, these tags should be removable, hence that collection's action should be .removeAction (more on how to be notified of tags events later).

    productTagsCollection.action 	= .removeTag
    
  3. Create a Text Field outlet and set its custom class to TKTextField

  4. Set the text field's .sender and .receiver properties. This enables the text field to add tags to a collection. The sender is a collection view that is displaying tags from the textfield (tags that should be filtered), while the receiver is the collection receiving the tags:

    textField.sender = allTagsCollection
    textField.receiver = productTagsCollection
    
  5. If you want the "filter" collection to be able to add tags, set these properties:

    allTagsCollection.action = .addTag
    allTagsCollection.receiver = productTagsCollection
    
  6. Lastly, you probably want to be notified and act upon tags being added or removed from a collection. For this purpose, TaggerKit lets you override these two methods in order to add your functionality (your controller must the delegate of the collections):

    allTagsCollection.delegate 	= self
    productTagsCollection.delegate 	= self
    
    
    override func tagIsBeingAdded(name: String?) {
    	// Example: save testCollection.tags to UserDefault
    	print("added \(name!)")
    }
    
    override func tagIsBeingRemoved(name: String?) {
    	print("removed \(name!)")
    }
    

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	
// Border for cells
    tagCollection.customTagBorderColor = UIColor.red
    tagCollection.customTagBorderSize = 2
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].