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.
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.
WeightedWordCloud is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'WeightedWordCloud', '0.1.0'
Maciej Swic, [email protected]
WeightedWordCloud is available under the MIT license. See the LICENSE file for more info.