WeightedWordCloud 0.2.1

WeightedWordCloud 0.2.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2015

Maintained by Maciej Swic.




Works with any Objective-C project, including app extensions like today widgets and Apple Watch (WatchKit) apps.

alt text

Example usage with WatchKit

Import the header

#import <WeightedWordCloud/HITWeightedWordCloud.h>

Create and configure a HITWeightedWordCloud object. You can do this in (void)awakeWithContext:(id)context

self.wordCloud = [HITWeightedWordCloud.alloc initWithSize:CGSizeMake(CGRectGetWidth(self.contentFrame), CGRectGetHeight(self.contentFrame)];
self.wordCloud.textColor = UIColor.whiteColor;
self.wordCloud.scale = WKInterfaceDevice.currentDevice.screenScale;

Set data and render a word cloud. The dictionary key is your word and the value is the weight. The weight controls the font size of the words in the rendered cloud.

NSDictionary *wordsDictionary = @{@"Very important": @500,
                                  @"Still important": @400,
                                  @"Less important": @100,
                                  @"Not important at all": @0};
[self.imageView setImage:[self.wordCloud imageWithWords:wordsDictionary]];

See the header file for more options.

Requirements

  • Xcode 6.3.1
  • ARC

Installation

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

pod 'WeightedWordCloud', '0.1.0'

Author

Maciej Swic, [email protected]

License

WeightedWordCloud is available under the MIT license. See the LICENSE file for more info.