- Xcode 11+
- SwiftUI
- iOS 14+
- macOS 10.15+
File โ Swift Packages โ Add Package Dependancy..
.package(url: "https://github.com/Changemin/TagField", from: "1.1.0")
TagField(tags: $tags, placeholder: "Add Tags..")
TagField(tags: $tags, placeholder: "Add Tags..", prefix: "#")
TagField(tags: $tags, placeholder: "Add Tags..", prefix: "#", color: color, style: .Modern, lowercase: bool)
tags
:Binding<String>
that stores tags dataplaceholder
: placeholder text before add tagsprefix
: prefix attached to each tagscolor
: accentColorstyle
:TagFieldStyle
โ.Modern
,.RoundedBorder
,.Multilined
TagField(tags: $tags, placeholder: "Add Tags..")
.accentColor(color)
.styled(TagFieldStyle)
.lowercase(Bool)
.accentColor()
: Accent color.styled()
:.RoundedBorder(default)
.Modern
.Multilined(on progress)
support different designs.lowercase
: enable force lowercase
import TagField
struct ContentView: View {
@State var tags: [String] = []
var body: some View {
TagField(tags: $tags, placeholder: "Add Tags..")
.padding()
}
}
import TagField
struct ContentView: View {
@State var tags: [String] = []
var body: some View {
TagField(tags: $tags, placeholder: "Add Tags..", prefix: "#")
.styled(.Modern)
.accentColor(.red)
.lowercase(true)
.padding()
}
}
-
Multilined
style
TagField is available under the MIT license. See the LICENSE
file for more info.
- Byun Kyung Min โ ๐ฐ๐ท@Changemin