Code Monkey home page Code Monkey logo

taglistview-objc's Introduction

TagListView-ObjC

Version License

Simple but highly customizable iOS tag list view, in Objective-C. The APIs are not stable before 1.0. Use it if you don't want to use the Swift version.

Supports Storyboard, Auto Layout, and @IBDesignable.

Screenshot

This project is a port to ObjC from XHacker's TagListView library, I tried to remain as compatible as possible. This README itself (and the images/screenshots) are from XHacker's too.

My motivation to do this: At work, I had an ObjC-written project, and want to use that library. I didn't like at all that my app increases 3MB on size (because Swift libs) for only a few code files. Using this version, the increase in size is very tiny (<5kb).

Usage

The most convinient way is to use Storyboard, where you can set the attributes right in the Interface Builder. With @IBDesignable, you can see the preview in real time.

Interface Builder

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

tagListView.textFont = [UIFont systemFontOfSize:24];

[tagListView addTag:@"meow"];

[tagListView removeTag:@"meow"]; // all tags with title “meow” will be removed
[tagListView removeAllTags];

You can also customize a particular tag:

TagView *tagView = [tagListView addTag:@"blue"];
tagView.tagBackgroundColor = [UIColor blueColor];

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

Installation

Turns out that installation via CocoaPods may be buggy. If you can't make it work from Interface Builder, please check this Stack Overflow answer. Using it without CocoaPods seems to work perfectly, though.

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

pod "TagListView-ObjC"

Instead, if you don't want to use CocoaPods, you can simply checkout the sample project. Library files are in the "TagListView/" folder, simply drag it into your project.

Contribution

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

License

TagListView-ObjC is available under the MIT license. See the LICENSE file for more info.

taglistview-objc's People

Contributors

pulimento avatar iossmurf avatar donly avatar imhanhan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.