Coder Social home page Coder Social logo

kajinka13 / dwtaglist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from domness/dwtaglist

1.0 1.0 0.0 115 KB

Create a list of tags from an NSArray to be show in a view with customisable fonts, colors etc.

Home Page: http://twitter.com/domness

Ruby 3.97% Objective-C 96.03%

dwtaglist's Introduction

DWTagList

Create a list of tags from an NSArray to be show in a view with customisable fonts, colors etc.

preview

Installation

Simple copy over DWTagList.h and DWTagList.m into your project and make sure you have linked the framework QuartzCore.framework.

You may then add tags to your view by the following lines of code:

// Initalise and set the frame of the tag list
tagList = [[DWTagList alloc] initWithFrame:CGRectMake(20.0f, 70.0f, 280.0f, 300.0f)];

// Add the items to the array
NSArray *array = [[NSArray alloc] initWithObjects:@"Foo", @"Tag Label 1", @"Tag Label 2", @"Tag Label 3", @"Tag Label 4", @"Tag Label 5", nil];
[tagList setTags:array];

// Add the taglist to your UIView
[self.view addSubview:tagList];

Customisation

In DWTagList.m there are a number of customisable options to change the layout and the aesthetics of the tags:

#define CORNER_RADIUS 10.0f
#define LABEL_MARGIN 5.0f
#define BOTTOM_MARGIN 5.0f
#define FONT_SIZE 13.0f
#define HORIZONTAL_PADDING 7.0f
#define VERTICAL_PADDING 3.0f
#define BACKGROUND_COLOR [UIColor colorWithRed:0.93 green:0.93 blue:0.93 alpha:1.00]
#define TEXT_COLOR [UIColor blackColor]
#define TEXT_SHADOW_COLOR [UIColor whiteColor]
#define TEXT_SHADOW_OFFSET CGSizeMake(0.0f, 1.0f)
#define BORDER_COLOR [UIColor lightGrayColor].CGColor
#define BORDER_WIDTH 1.0f

NOTE: In the future, these will be added as methods that can be used to customise the tags after initialisation.

dwtaglist's People

Contributors

domness avatar kajinka13 avatar link82 avatar runmad avatar

Stargazers

 avatar

Watchers

 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.