Created
March 3, 2021 05:25
-
-
Save DavidPiper94/255747d573bf2f6ef15fbf9b0e6f51c2 to your computer and use it in GitHub Desktop.
Example code for article about TagCloudView - Using a TagCloudView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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