DKTagCloudView 1.0.0

DKTagCloudView 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Bannings.



  • By
  • Bannings

GIF GIF

Overview

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

How To Get Started

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.