CircularWordsCloud
Circular Words Cloud with N-Words Selector ( + M-Depth Searching)
Made with Team SISISI by k-elon.
Circular Words Cloud for iOS !
CircularWordsCloud is a Container View that allows us to implement word map easily. You can use it for presenting Word Relationships or TItle-Subtitles Architecture (like Tree).
![]() |
![]() |
![]() |
---|
CircularWordsCloud Types
n-words selecting type
![]() [nWords = 3] |
![]() [nWords = 6] |
![]() [nWords = 8] |
![]() [nWords = 11] |
---|
m-depth searching type
position types
![]() [position = bottom] |
![]() [position = center] |
![]() [position = top] |
---|
Usage
Basically, we just need to add CircularWordsCloud as subview of your view which will be superview of it. And you should set delegate of it.
The size of the view and the autolayouts are set automatically. Ofcourse you can custom if you want!
Let's see the steps to do this:
Set CircularWordsCloud
override func viewDidLoad() {
super.viewDidLoad()
let circularWordsCloud = CircularWordsCloud()
circularWordsCloud.delegate = self
view.addSubview(circularWordsCloud)
}
Isn't it really simple ?! Now you can use CircularWordsCloud if you meet a few things.
extension ViewController: CircularWorsCloudDelegate {
var wordForAxis: String {
return "CenterWord"
}
var wordsForCloud: [String] {
return ["Words","That","You","Want","Show","Around", "The", "Central Word"]
}
}
What you need to do. s really over.
Options
You can do some customization with the support of CircularWordsCloud.
Select Position
public enum CircularWordsCloudPosition {
case top, bottom, center
}
let circularWordsCloud = CircularWordsCloud(position: .top) // default = .center
M-Depth Seaching Process
circularWordsCloud.enableLongPressGesture = true
You can press and hold a word to use the feature to move to the new word cloud. Like below.
Give Weight on Words
extension ViewController: CircularWorsCloudDelegate {
var ranksForWords: [Int] {
return [1,7,5,2,6,2,7,3]
}
}
You can give weight on your words. Then the size changes to match the weight assigned to each word.
Event Listeners
@objc public protocol CircularWorsCloudDelegate: NSObjectProtocol {
// MARK:- Functions
@objc optional func circularWordsCloud(_ circularWordsCloud: CircularWordsCloud,
didSelectWord: String)
@objc optional func circularWordsCloud(_ circularWordsCloud: CircularWordsCloud,
didDeselectWord: String)
@objc optional func circularWordsCloudDidExpand()
@objc optional func circularWordsCloudDidCollapse()
@objc optional func circularWordsCloud(_ circularWordsCloud: CircularWordsCloud,
newAxisWord: String,
depth: Int,
completion: @escaping ( _ newCloudWords: [String])-> Void)
}
You can handle various events in CircularWordsCloud.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- Xcode 10+
- Swift4+
Installation
CircularWordsCloud is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CircularWordsCloud'
Author
minsub0922, [email protected]
License
CircularWordsCloud is available under the MIT license. See the LICENSE file for more info.