How can I make tag list in Swift?

柔情痞子 提交于 2021-02-17 19:46:51

问题


I want to create a list of tags, what I'll take from an array, but how can I stylize it as:

inside of bubbles and auto place in the next row if the line is full. Any tips or ideas?


回答1:


Please read this library link giving below it has awesome and custom tag design all the things you required for your design.

https://github.com/ElaWorkshop/TagListView

Here is how to use it.

  1. add its cocoapods [pod "TagListView"].
  2. Create a view on which you wanna to show your selected tags and constraint it.
  3. change your view class name to "TagListView".
  4. set delegate on viewDidLoad(). [yourView.delegate = self]
  5. now you use it. eg.

yourView.addTag("Name on Tag") or yourView.addTags(["Name on Tag First","Name on Tag second","Name on tag third",.....and so on])




回答2:


I have implemented a simple and customizable tag list view in swift using a collection view.

Here is my github link.



来源:https://stackoverflow.com/questions/33625895/how-can-i-make-tag-list-in-swift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!