Simple and highly customizable iOS tag list view, in Swift.

Related tags

Tag TagListView
Overview

TagListView

Travis CI Version License Carthage compatible

Simple and highly customizable iOS tag list view, in Swift.

Supports Storyboard, Auto Layout, and @IBDesignable.

Screenshot

Usage

The most convenient way is to use Storyboard. Drag a view to Storyboard and set Class to TagListView (if you use CocoaPods, also set Module to TagListView). Then you can play with the attributes in the right pane, and see the preview in real time thanks to @IBDesignable.

Interface Builder

You can add tag to the tag list view, or set custom font and alignment through code:

tagListView.textFont = UIFont.systemFont(ofSize: 24)
tagListView.alignment = .center // possible values are [.leading, .trailing, .left, .center, .right]
tagListView.minWidth = 57

tagListView.addTag("TagListView")
tagListView.addTags(["Add", "two", "tags"])

tagListView.insertTag("This should be the second tag", at: 1)

tagListView.setTitle("New Title", at: 6) // to replace the title a tag

tagListView.removeTag("meow") // all tags with title “meow” will be removed
tagListView.removeAllTags()

You can implement TagListViewDelegate to receive tag pressed event:

// ...
{
    // ...
    tagListView.delegate = self
    // ...
}

func tagPressed(title: String, tagView: TagView, sender: TagListView) {
    print("Tag pressed: \(title), \(sender)")
}

You can also customize a particular tag, or set tap handler for it by manipulating the TagView object returned by addTag(_:):

let tagView = tagListView.addTag("blue")
tagView.tagBackgroundColor = UIColor.blueColor()
tagView.onTap = { tagView in
    print("Don’t tap me!")
}

Be aware that if you update a property (e.g. tagBackgroundColor) for a TagListView, all the inner TagViews will be updated.

Installation

Use CocoaPods:

pod 'TagListView', '~> 1.0'

Or Carthage:

github "ElaWorkshop/TagListView" ~> 1.0

Or drag TagListView folder into your project.

Older Swift Versions?

Currently, the master branch is using Swift 5.

For Swift 4, use version 1.3.2 or swift-4 branch. For Swift 3, use version 1.2.0 or swift-3 branch. For Swift 2, use version 1.0.1 or swift-2.3 branch. For Swift 1.2, use version 0.2.

Contribution

Pull requests are welcome! If you want to do something big, please open an issue to let me know first.

License

MIT

Comments
  • TagListView 1.1.0 Swift 3.0 EXC_BAD_ACCESS

    TagListView 1.1.0 Swift 3.0 EXC_BAD_ACCESS

    while adding tags to the taglistview I am gettiing exc_bad_access error. How to resolve this one.


    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    question wontfix 
    opened by gsujathap 27
  • Incorrect height when using auto size UITableViewCell

    Incorrect height when using auto size UITableViewCell

    It's a little bit difficult to describe this problem, so I create a demo(Xcode 8 and Swift 3.0) to show this case.

    I using autoLayout to make the TagListView equal to cell's contentView. But the first time load UITableView, you can see UITableViewCell height is not correct.

    After scroll out the cell(invisible), and scroll back, the cell shows correctly.

    I think this problem may cause by function intrinsicContentSize.

    bug question 
    opened by tinpont 24
  • Incorrect sizing in UITableViewCell depending on frame in storyboard (project attached)

    Incorrect sizing in UITableViewCell depending on frame in storyboard (project attached)

    Hi there,

    I've noticed that the TagListView, when configured in a UITableViewCell in a storyboard, may incorrectly render with the bottom cut off depending on the size of the view controller in the storyboard. I've created a quick project to demonstrate the problem: https://github.com/UberJason/TagListViewStoryboardBug

    I tried to look through the code of TagListView quickly, but nothing jumped out at me to explain the problem. Hope you might have a better idea than I do!

    question 
    opened by UberJason 20
  • Problem after updating pod to 1.3.1 version / Swift 4.2

    Problem after updating pod to 1.3.1 version / Swift 4.2

    Guys, could you suggest, what I am doing wrong. In project I see, that TagListView pod was updated successfully to latest version 1.3.1. I checked it few times. However the code of pod seems to be still not at Swift 4.2. Check my screenshot for reference.
    http://snpy.in/lohHYG http://snpy.in/xaeMd7 Probably I did something wrong, but can figure out what exactly.

    opened by Kharauzov 10
  • Add multi tags at one time

    Add multi tags at one time

    Can I add multi tags at one time? Something like addTags function.

    Now I can just add tag one by one, which will slow down performance.

    - (NSArray<TagView *> *)addTags:(NSArray<NSString *> *)tagNames {
        for (NSString *tagName in tagNames) {
            [self addTag:tagName];
        }
        return self.tagViews;
    }
    
    feature request 
    opened by tinpont 8
  • Drag into project, then swift compile error

    Drag into project, then swift compile error

    Problem : Swift compiler error in TagView .

    2018-06-27 6 51 00

    I use cocoaPods in my project, but I need some customize in TagListView.
    So I drag TagListView folder in my project. Then Swift compiler error... ( use Swift 4.1)

    question 
    opened by CACRogerWang 7
  • Fixes #43 - Invalidate intrinsic content size on rearrange of views

    Fixes #43 - Invalidate intrinsic content size on rearrange of views

    When the views are rearranged, we need to invalidate the existing intrinsic content size of the TagListView to update sizing elsewhere.

    This fixes #43 but updating the size of the TagListView when it is updated with new data, forcing the self sizing cells to correctly resize.

    opened by aaronpearce 6
  • How would we center the tags?

    How would we center the tags?

    I would like to center all the tags so we don't have all the spaces in the right of our view. Like Flipboard for example: img_1109

    How would we get this to work??

    feature request 
    opened by sehunchoi 6
  • Deleting tags

    Deleting tags

    Hey,

    I haven't downloaded or played with the code yet, but this is something I'm thinking of using very soon in my app. I was just wondering if maybe there's a way to have something like an "X" to delete and its own dedicated touch event for it?

    So in other words, I'd like the user to be easily remove tags manually by pressing the "X" icon, without having to go into an "edit" mode. I was thinking of having a the "X" to the left and then to the right the normal text.

    feature request 
    opened by jyounus 6
  • Multiple text colour in array does not set

    Multiple text colour in array does not set

    I have the tags and colour in an array and I set the tag by adding addTag property and the text colour for that tag, but they only pick the text colour of the last element in the array.

    question wontfix 
    opened by naveen114 5
  • tagRemoveButtonPressed stop working suddenly

    tagRemoveButtonPressed stop working suddenly

    When I click on tag following action is being called

    func tagPressed(_ title: String, tagView: TagView, sender: TagListView) {
            print("Tag pressed: \(title)")
    }
    

    but when I click on closeButton

    func tagRemoveButtonPressed(_ title: String, tagView: TagView, sender: TagListView) {
    
    }
    

    was not being called it was working previously but suddenly stop working.

    I am using Xcode 9.3

    wontfix 
    opened by shaharukhs 5
  • Update image and position of remove button

    Update image and position of remove button

    Hi, I am using this library from years and it is really good. At this point I want to change image of remove button and its position before the tag text instead of at the end. Please help how can I do this.

    opened by ranamateen 0
  • Version 1.4.1 don’t have minwidth

    Version 1.4.1 don’t have minwidth

    Version CocoaPods 1.4.1 don’t have minWidth. The packaged version does not include minWidth: https://github.com/ElaWorkshop/TagListView/archive/refs/tags/1.4.1.zip

    opened by tranhoanganh 1
Releases(1.4.1)
Owner
Ela Workshop
Two craftsmen living in the middle-earth.
Ela Workshop
Highly customizable iOS tags view [input, edit, dynamic, tag, token, field, NSTokenField]

RKTagsView Highly customizable iOS tags view (like NSTokenField). Supports horizontal and vertical direction, editing, multiple selection, Auto Layout

Roman Kulesha 450 Oct 2, 2022
UIScrollView subclass that allows to add a list of highly customizable tags.

UIScrollView subclass that allows to add a list of highly customizable tags. You can customize colors, border radius, and the tail of the tag. Tags ca

Andrea Mazzini 765 Nov 19, 2022
Made in Swift - Tag layout for UICollectionView supporting 3 types of alignments - Left || Centre || Right

TagCellLayout About Its an ui-collection-view LAYOUT class that takes care of all the logic behind making tags like layout using UICollectionView. It

Ritesh Gupta 346 Jan 1, 2023
Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time

Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time. It is highly customizable that most features of the text tag can be configured.

zekunyan 1.8k Dec 30, 2022
TagsGridView: A simple view for your tags

TagsGridView: A simple view for your tags. Requirements Installation Contents License Support Credits Requirements iOS 14, macOS 10.15 Swift 5.5 Xcode

Alex 5 Nov 4, 2021
This pod provides a view controller for choosing and creating tags in the style of wordpress or tumblr.

PARTagPicker This pod provides a view controller for choosing and creating tags in the style of wordpress or tumblr. This tag picker was originally us

Paul Rolfe 370 Nov 17, 2022
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction ?? Awesome search view, written in Swift 5.0, appears search view like Pinteres

Kyle Yi 1.2k Dec 17, 2022
An iOS text field that represents tags, hashtags, tokens in general.

WSTagsField An iOS text field that represents tags, hashtags, tokens in general. Usage let tagsField = WSTagsField() tagsField.layoutMargins = UIEdgeI

Whitesmith 1.2k Jan 9, 2023
Swift plugin which allow add mask to input field

AKMaskField AKMaskField is UITextField subclass which allows enter data in the fixed quantity and in the certain format (credit cards, telephone numbe

Artem Krachulov 347 Jul 19, 2022
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.5k Dec 28, 2022
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.5k Dec 31, 2022
Highly customizable iOS tags view [input, edit, dynamic, tag, token, field, NSTokenField]

RKTagsView Highly customizable iOS tags view (like NSTokenField). Supports horizontal and vertical direction, editing, multiple selection, Auto Layout

Roman Kulesha 450 Oct 2, 2022
Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it.

SwiftUI TagView Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it. Usage: Just copy the

Ahmadreza 16 Dec 28, 2022
UIScrollView subclass that allows to add a list of highly customizable tags.

UIScrollView subclass that allows to add a list of highly customizable tags. You can customize colors, border radius, and the tail of the tag. Tags ca

Andrea Mazzini 765 Nov 19, 2022
Flow layout / tag cloud / collection view in SwiftUI.

SwiftUIFlowLayout A Flow Layout is a container that orders its views sequentially, breaking into a new "line" according to the available width of the

Gordan Glavaš 115 Dec 28, 2022
🌈 Highly customizable Core Graphics based gradient view for iOS

MKGradientView Highly customizable Core Graphics based gradient view Features Available gradient types: Linear (Axial) Radial (Circular) Conical (Angu

Max Konovalov 167 Dec 27, 2022
A paging view controller with a highly customizable menu ✨

Getting Started | Customization | Installation Features Parchment lets you page between view controllers while showing any type of generic indicator t

Martin Rechsteiner 3k Jan 8, 2023
Easy to use, highly customizable gauge view

GDGauge - Customizable Gauge View Requirements Xcode 11+ Swift 5 iOS 9+ Installation Swift Package Manager .package(url: "https://github.com/saeid/GDG

Saeid 74 Dec 5, 2022
FYPhoto is a photo/video picker and image browser library for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.

FYPhoto is a photo/video picker and image browser library for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.

null 10 Dec 11, 2022
When you scan the clothing tag, a 3D character appears and informs you of the clothing information.

1. Introduction When you scan the clothing tag, a 3D character appears and tells you the information on the clothes. You can select necessary informat

kimniki 0 Dec 23, 2021