{"id":15038743,"url":"https://github.com/billypchan/gravitytagcloudview","last_synced_at":"2025-04-10T00:03:22.954Z","repository":{"id":56912958,"uuid":"83886993","full_name":"billypchan/GravityTagCloudView","owner":"billypchan","description":"A tag cloud view with gravity.","archived":false,"fork":false,"pushed_at":"2017-11-04T09:36:31.000Z","size":12282,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:02:41.010Z","etag":null,"topics":["2017","cocoapod","gravity","playground","swift-3","tag-cloud","uidynamics","uilabel","xcode8"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/billypchan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-04T10:57:35.000Z","updated_at":"2024-12-11T09:25:09.000Z","dependencies_parsed_at":"2022-08-21T03:20:32.430Z","dependency_job_id":null,"html_url":"https://github.com/billypchan/GravityTagCloudView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billypchan%2FGravityTagCloudView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billypchan%2FGravityTagCloudView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billypchan%2FGravityTagCloudView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billypchan%2FGravityTagCloudView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billypchan","download_url":"https://codeload.github.com/billypchan/GravityTagCloudView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131321,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2017","cocoapod","gravity","playground","swift-3","tag-cloud","uidynamics","uilabel","xcode8"],"created_at":"2024-09-24T20:39:59.785Z","updated_at":"2025-04-10T00:03:22.925Z","avatar_url":"https://github.com/billypchan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GravityTagCloudView\nA 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/).\n\n\u003cimg src=\"https://raw.githubusercontent.com/billypchan/GravityTagCloudView/master/doc/animalsTag.gif\" width=\"320\" /\u003e\n\n\nYou may play around GravityTagCloudView on [Apptize](https://appetize.io/app/y16mxjyzgrd9bkh0cq38ac4qng).\n\nFill some bugs in the iPhone SE screen:\n\n\u003cimg src=\"https://raw.githubusercontent.com/billypchan/GravityTagCloudView/master/doc/tagsOfbugs.png\" width=\"200\" /\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/billypchan/GravityTagCloudView/master/doc/tagsOfbugs_generateThreeTimes.png\" width=\"200\" /\u003e\n\n(To measure the performance of UIDynamic, you may include [konoma/fps-counter](https://github.com/konoma/fps-counter) in your project.)\n\nPlayground example:\n\nPlay with random font size:\n\n![PNG](https://raw.githubusercontent.com/billypchan/GravityTagCloudView/master/doc/randomFontSize.png)\n\nPlay with weighted font size and fill the entire view with tags:\n\n![PNG](https://raw.githubusercontent.com/billypchan/GravityTagCloudView/master/doc/playground.png)\n\n## How To Get Started\n\n### Installation with CocoaPods\n\nEdit your Podfile and add DKTagCloudView, (TODO add to offical pod spec):\n\n``` bash\npod 'GravityTagCloudView', '~\u003e 0.2.0'\n```\n\nAdd `import GravityTagCloudView` to the top of classes that will use it.  \n#### Create instances (Also supports xib/storyboard) :\n\n``` Swift\nlet gravityTagCloudView = GravityTagCloudView()\n\ngravityTagCloudView.frame = CGRect(x: 0, y: 0, width: 360, height: 200)\n\nself.view.addSubview(gravityTagCloudView)\n\n```\n\n#### Setup items:\n\nIf you want the size of the label is propertional to their weight, please set labelSizeType properties to kWeighted and assign  array to titleWeights:\n\n``` Swift\ngravityTagCloudView.labelSizeType = .weighted\ngravityTagCloudView.titleWeights = [[\"title\":\"elephant\", \"weight\":10],\n                                    [\"title\":\"cow\", \"weight\":7],\n                                    [\"title\":\"horse\", \"weight\":7],\n                                    [\"title\":\"dog\", \"weight\":5],\n                                    [\"title\":\"cat\", \"weight\":3],\n                                    [\"title\":\"rat\", \"weight\":1],\n                                    [\"title\":\"mouse\", \"weight\":1],\n                                    ]\n```\n\n#### Generates:\n\n``` Swift\ngravityTagCloudView.generate()\n```\n\n#### Callback\n\n``` Swift\ngravityTagCloudView.tagClickBlock = { title, tag -\u003e Void in       \n  print(\"tag =\\(tag), title=\\(title)\")\n}\n```\n\n#### Customized:\n\n``` Swift\n\n/**\n\n *  Label size option. Defautls to random.\n */\npublic var labelSizeType : LabelSizeType = .random\n\n/**\n *  Gravity enabled?\n */\npublic var isGravity : Bool = true\n\n/**\n *  Min font size. Defautls to 14.\n */\npublic var minFontSize : Float = 14\n\n/**\n *  Max font size. Defaults to 60.\n */\npublic var maxFontSize : Float = 60\n\n/**\n *  Random text colors with default list\n */\npublic var randomColors = [UIColor.black, UIColor.cyan, UIColor.purple, UIColor.orange, UIColor.red, UIColor.yellow, UIColor.lightGray, UIColor.gray, UIColor.green]\n```\n\n## License\nThis code is distributed under the terms and conditions of the \u003ca href=\"https://github.com/zhangao0086/DKTagCloudView/master/LICENSE\"\u003eMIT license\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillypchan%2Fgravitytagcloudview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillypchan%2Fgravitytagcloudview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillypchan%2Fgravitytagcloudview/lists"}