Skip to content

Instantly share code, notes, and snippets.

@DavidPiper94
Created March 3, 2021 05:25
Show Gist options
  • Select an option

  • Save DavidPiper94/255747d573bf2f6ef15fbf9b0e6f51c2 to your computer and use it in GitHub Desktop.

Select an option

Save DavidPiper94/255747d573bf2f6ef15fbf9b0e6f51c2 to your computer and use it in GitHub Desktop.
Example code for article about TagCloudView - Using a TagCloudView
// 1
let tagCloudView = TagCloudView()
let items = ["This", "is", "a", "test"]
.map(TagCloudItemViewModel.init(title:))
tagCloudView.addItems(items: items)
// 2
class Delegate: TagCloudViewDelegate {
func removeClicked(title: String) {
print("Clicked remove button on tag \(title)")
}
}
tagCloudView.delegate = Delegate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment