GithubHelp home page GithubHelp logo

jh90ios / dktagcloudview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhangao0086/dktagcloudview

0.0 2.0 0.0 845 KB

A tag clouds view on iOS.

License: MIT License

Ruby 5.85% Objective-C 94.15%

dktagcloudview's Introduction

DKTagCloudView

GIF GIF

Overview

DKTagCloudView is a tag clouds view on iOS. It can generate a random and not intersects coordinates.

How To Get Started

Installation with CocoaPods

$ pod search DKTagCloudView

-> DKTagCloudView (1.0.0)
   A tag clouds view on iOS.t can generate a random and not intersects
   coordinates.
   pod 'DKTagCloudView', '~> 1.0.0'
   - Homepage: https://github.com/zhangao0086/DKTagCloudView
   - Source:   https://github.com/zhangao0086/DKTagCloudView.git
   - Versions: 1.0.0 [master repo]

Edit your Podfile and add DKTagCloudView:

pod 'DKCarouselView', '~> x.x.x'

Add #import "DKTagCloudView.h" to the top of classes that will use it.

Create instances (Also supports xib/storyboard) :

DKTagCloudView *tagCloudView = [[DKTagCloudView alloc] initWithFrame:CGRectMake(0, 64,
                                                                                self.view.bounds.size.width,
                                                                                self.view.bounds.size.height - 64)];
[self.view addSubview:tagCloudView];
self.tagCloudView = tagCloudView;

Setup items:

self.tagCloudView.titls = @[
                            @"DKTagCloudView",
                            @"minFontSize",
                            @"maxFontSize",
                            @"randomColors",
                            @"generate",
                            @"UIView",
                            @"NSInteger",
                            @"Min font size",
                            @"Max font size",
                            @"DKTagCloudViewDemo",
                            @"This is a test"
                            ];

Generates:

[self.tagCloudView generate];

Callback

[self.tagCloudView setTagClickBlock:^(NSString *title, NSInteger index) {
    NSLog(@"title:%@,index:%zd",title,index);
}];

Customized:

/**
 *  Min font size. Defautls to 14.
 */
@property (nonatomic, assign) NSInteger minFontSize;

/**
 *  Max font size. Defaults to 60.
 */
@property (nonatomic, assign) NSInteger maxFontSize;

/**
 *  Random text colors. Defaults to: 
 [
         [UIColor blackColor],
         [UIColor cyanColor],
         [UIColor purpleColor],
         [UIColor orangeColor],
         [UIColor redColor],
         [UIColor yellowColor],
         [UIColor lightGrayColor],
         [UIColor grayColor],
         [UIColor greenColor],
 ]
 */
@property (nonatomic, copy) NSArray *randomColors;

License

This code is distributed under the terms and conditions of the MIT license.

dktagcloudview's People

Contributors

zhangao0086 avatar

Watchers

James Cloos avatar snowKing 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.