MultiLineTagView
This code has been modified by referring to another code. (Original Code Blog)
Using Swift, SnapKit
This code was written using SnapKit. If you use a Storyboard or other UI library, you will have to modify it yourself.
import UIKit
import SnapKit
classViewController:UIViewController{
lazy varmultiLineTagView:MultiLineTagView={letview:MultiLineTagView=MultiLineTagView(rowHeight:100)
view.delegate =selfreturn view
}()overridefunc viewDidLoad(){
super.viewDidLoad()self.view.backgroundColor =.white
self.view.addSubview(self.multiLineTagView)self.multiLineTagView.snp.makeConstraints{
$0.top.equalToSuperview().offset(100)
$0.leading.trailing.equalToSuperview().inset(30)}letwords:[String]=["Tag1","Tag2","Tag3","Tag Tag Reee Test","Hi My","Github"]self.multiLineTagView.setTag(words: words)}}extensionViewController:MultiLineTagViewDelegate{func selectTag(tag:String){print("Select Tag: \(tag)")}func deleteTag(tag:String){print("Delete Tag: \(tag)")}}MultiLineTagViewDelegate
- selectTag(tag: String)
- deleteTag(tag: String)
Add features that fit your app service with Select and Delete Delegate.
Example Delegate exists for selection and deletion. Only the UI can be modified and used while maintained, and if you don't need Delegate, please modify the UI and Delegate together.

