All Projects → billypchan → GravityTagCloudView

billypchan / GravityTagCloudView

Licence: MIT license
A tag cloud view with gravity.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to GravityTagCloudView

Imagecoordinatespace
UICoordinateSpace for UIImageView image
Stars: ✭ 42 (+90.91%)
Mutual labels:  playground, cocoapod
Ghosttypewriter
👻 A UILabel subclass that adds a typewriting animation effect
Stars: ✭ 159 (+622.73%)
Mutual labels:  uilabel, cocoapod
RZColorful
NSAttributedString富文本的方法集合,以及简单优雅的使用其多种属性
Stars: ✭ 53 (+140.91%)
Mutual labels:  uilabel
extkeras
Playground for implementing custom layers and other components compatible with keras, with the purpose to learn the framework better and perhaps in future offer some utils for others.
Stars: ✭ 18 (-18.18%)
Mutual labels:  playground
ParseCareKit
Securely synchronize any CareKit 2.1+ based app to a Parse Server Cloud. Compatible with parse-hipaa.
Stars: ✭ 28 (+27.27%)
Mutual labels:  cocoapod
pg-deadlock-playground
Playground for verifying that queries cannot deadlock
Stars: ✭ 17 (-22.73%)
Mutual labels:  playground
PathView
Simulate the running route of each player on the playground, and can be timed with a stopwatch
Stars: ✭ 5 (-77.27%)
Mutual labels:  playground
pikko
Color picker for iOS made with ❤️
Stars: ✭ 34 (+54.55%)
Mutual labels:  cocoapod
goplay
The Go Playground (https://play.golang.org/) client
Stars: ✭ 75 (+240.91%)
Mutual labels:  playground
whats-new-in-swift-5-2
An Xcode playground that demonstrates the new features introduced in Swift 5.2.
Stars: ✭ 94 (+327.27%)
Mutual labels:  playground
jscore-playground
JavaScriptCore example for Swift Playgrounds
Stars: ✭ 17 (-22.73%)
Mutual labels:  playground
react-runner
Run your React code on the go
Stars: ✭ 308 (+1300%)
Mutual labels:  playground
HeadFirstDesignPatternsSwift
An implementation of examples from "Head First Design Patterns", written in Swift.
Stars: ✭ 20 (-9.09%)
Mutual labels:  playground
meeting-app-unit-tests-playground
Unit tests patterns when using JEST and Vue2 (vue-test-utils)
Stars: ✭ 21 (-4.55%)
Mutual labels:  playground
CodeINN
CodeINN is an instant code editor 📃, that makes programming and development easier. Practice quickly and directly from your web browser, without any setup needed. CodeINN gives the perfect environment to developers technologists, coders computers, and geeks 🤓 to do more with their tech.
Stars: ✭ 39 (+77.27%)
Mutual labels:  playground
APNsKit
A framework to send Apple Notifications
Stars: ✭ 20 (-9.09%)
Mutual labels:  playground
authorize-me
Authorization with social networks
Stars: ✭ 44 (+100%)
Mutual labels:  cocoapod
DSFFloatLabelledTextControl
A macOS Cocoa single-line NSTextField/NSSecureTextField that implements the Float Label Pattern.
Stars: ✭ 21 (-4.55%)
Mutual labels:  cocoapod
prompts-ai
Advanced playground for GPT-3
Stars: ✭ 156 (+609.09%)
Mutual labels:  playground
PastaBean
Python Script to Scrape Pastebin with Regex
Stars: ✭ 0 (-100%)
Mutual labels:  2017

GravityTagCloudView

A tag cloud view with gravity for iOS. It is a rewritten version of https://github.com/zhangao0086/DKTagCloudView in swift 3 with UIdynamics gravity support (Thanks for this nice tutorial for UI dynamics - https://www.bignerdranch.com/blog/uidynamics-in-swift/).

You may play around GravityTagCloudView on Apptize.

Fill some bugs in the iPhone SE screen:

(To measure the performance of UIDynamic, you may include konoma/fps-counter in your project.)

Playground example:

Play with random font size:

PNG

Play with weighted font size and fill the entire view with tags:

PNG

How To Get Started

Installation with CocoaPods

Edit your Podfile and add DKTagCloudView, (TODO add to offical pod spec):

pod 'GravityTagCloudView', '~> 0.2.0'

Add import GravityTagCloudView to the top of classes that will use it.

Create instances (Also supports xib/storyboard) :

let gravityTagCloudView = GravityTagCloudView()

gravityTagCloudView.frame = CGRect(x: 0, y: 0, width: 360, height: 200)

self.view.addSubview(gravityTagCloudView)

Setup items:

If you want the size of the label is propertional to their weight, please set labelSizeType properties to kWeighted and assign array to titleWeights:

gravityTagCloudView.labelSizeType = .weighted
gravityTagCloudView.titleWeights = [["title":"elephant", "weight":10],
                                    ["title":"cow", "weight":7],
                                    ["title":"horse", "weight":7],
                                    ["title":"dog", "weight":5],
                                    ["title":"cat", "weight":3],
                                    ["title":"rat", "weight":1],
                                    ["title":"mouse", "weight":1],
                                    ]

Generates:

gravityTagCloudView.generate()

Callback

gravityTagCloudView.tagClickBlock = { title, tag -> Void in       
  print("tag =\(tag), title=\(title)")
}

Customized:

/**

 *  Label size option. Defautls to random.
 */
public var labelSizeType : LabelSizeType = .random

/**
 *  Gravity enabled?
 */
public var isGravity : Bool = true

/**
 *  Min font size. Defautls to 14.
 */
public var minFontSize : Float = 14

/**
 *  Max font size. Defaults to 60.
 */
public var maxFontSize : Float = 60

/**
 *  Random text colors with default list
 */
public var randomColors = [UIColor.black, UIColor.cyan, UIColor.purple, UIColor.orange, UIColor.red, UIColor.yellow, UIColor.lightGray, UIColor.gray, UIColor.green]

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].