- iOS 14, macOS 10.15
- Swift 5.5
- Xcode 12.5+
The preferred way of installing SwiftUIX is via the Swift Package Manager.
Xcode 12 integrates with libSwiftPM to provide support for iOS, watchOS, macOS and tvOS platforms.
- In Xcode, open your project and navigate to File → Swift Packages → Add Package Dependency...
- Paste the repository URL (
https://github.com/alexwillrock/TagsGridView
) and click Next. - For Rules, select Branch (with branch set to
master
). - Click Finish.
struct Tag: Hashable {
let title: String
let color: Color
}
struct TagView: View {
let tag: Tag
var body: some View {
Text(tag.title)
.lineLimit(1)
.font(.caption2)
.padding(.all, 6)
.background {
RoundedRectangle(cornerRadius: 8)
.foregroundColor(tag.color)
}
}
}
var body: some View {
HStack {
Spacer()
TagsGridView(data: tags,
spacing: 4,
alignment: .leading) { item in
TagView(tag: item)
.frame(height: 25)
}
Spacer()
}
}
TagsGridView is licensed under the MIT License.
TagsGridView is a project of @alexwillrock.