Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ElaWorkshop/TagListView
Simple and highly customizable iOS tag list view, in Swift.
https://github.com/ElaWorkshop/TagListView
Last synced: 3 days ago
JSON representation
Simple and highly customizable iOS tag list view, in Swift.
- Host: GitHub
- URL: https://github.com/ElaWorkshop/TagListView
- Owner: ElaWorkshop
- License: mit
- Created: 2015-05-10T00:04:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T19:54:50.000Z (about 1 year ago)
- Last Synced: 2024-10-29T15:29:33.786Z (about 1 month ago)
- Language: Swift
- Homepage:
- Size: 372 KB
- Stars: 2,643
- Watchers: 33
- Forks: 492
- Open Issues: 118
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - TagListView - Simple and highly customizable iOS tag list view, in Swift. (UI / Tag)
- awesome-swift - TagListView - Simple but highly customizable iOS tag list view. (Libs / UI)
- awesome-cocoa - TagListView
- awesome-swift - TagListView - Simple but highly customizable iOS tag list view. (Libs / UI)
- awesome-ios-star - TagListView - Simple and highly customizable iOS tag list view, in Swift. (UI / Tag)
- fucking-awesome-swift - TagListView - Simple but highly customizable iOS tag list view. (Libs / UI)
- awesome-swift-lib-hunt - TagListView - Very easy to implement and customizable tag list library (UI)
- awesome-swift-lib-hunt - TagListView - Very easy to implement and customizable tag list library (UI)
- awesome-swift - TagListView - Simple and highly customizable iOS tag list view, in Swift. ` π 4 months ago ` (UI [π](#readme))
- awesome - TagListView - Simple and highly customizable iOS tag list view, in Swift. (iOS / ListView)
- awesome - TagListView - Simple and highly customizable iOS tag list view, in Swift. (iOS / ListView)
README
# TagListView
[![Travis CI](https://travis-ci.org/ElaWorkshop/TagListView.svg)](https://travis-ci.org/ElaWorkshop/TagListView)
[![Version](https://img.shields.io/cocoapods/v/TagListView.svg?style=flat)](http://cocoadocs.org/docsets/TagListView/)
[![License](https://img.shields.io/cocoapods/l/TagListView.svg?style=flat)](https://github.com/ElaWorkshop/TagListView/blob/master/LICENSE)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)Simple and highly customizable iOS tag list view, in Swift.
Supports Storyboard, Auto Layout, and @IBDesignable.
## 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](http://nshipster.com/ibinspectable-ibdesignable/).
You can add tag to the tag list view, or set custom font and alignment through code:
```swift
tagListView.textFont = UIFont.systemFont(ofSize: 24)
tagListView.alignment = .center // possible values are [.leading, .trailing, .left, .center, .right]
tagListView.minWidth = 57tagListView.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:
```swift
// ...
{
// ...
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(_:)`:
```swift
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 `TagView`s will be updated.
## Installation
Use [CocoaPods](https://github.com/CocoaPods/CocoaPods):
```ruby
pod 'TagListView', '~> 1.0'
```Or [Carthage](https://github.com/Carthage/Carthage):
```ruby
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](https://github.com/ElaWorkshop/TagListView/releases/tag/1.3.2) or [swift-4](https://github.com/ElaWorkshop/TagListView/tree/swift-4) branch. For Swift 3, use version [1.2.0](https://github.com/ElaWorkshop/TagListView/releases/tag/1.2.0) or [swift-3](https://github.com/ElaWorkshop/TagListView/tree/swift-3) branch. For Swift 2, use version [1.0.1](https://github.com/ElaWorkshop/TagListView/releases/tag/1.0.1) or [swift-2.3](https://github.com/ElaWorkshop/TagListView/tree/swift-2.3) branch. For Swift 1.2, use version [0.2](https://github.com/ElaWorkshop/TagListView/releases/tag/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