基于 SwiftUI 的又一个组件库
Figma 中的控件和样式
可用控件包括
core 文件夹中的颜色、排版、间距和其他样式
https://github.com/oversizedev/OversizeUI.git
框架添加完成后,您可以导入模块来使用它
import OversizeUI
要构建和部署演示程序,请按照以下步骤操作
Example/Example.xcodeproj
。Example (iOS)
或其他,并选择要部署到的设备。Avatar(firstName: "Swift", lastName: "Apple")
.controlSize(.large)
Button("Button") { print(#function) }
.buttonStyle(.primary)
.accent()
.controlBorderShape(.capsule)
.bordered()
ColorSelector(selection: $color)
ColorSelector(selection: $color)
.colorSelectorStyle(GridColorSelectorStyle())
var items = ["One", "Two", "Three", "Four"]
@State var selection = ""
GridSelect(items, selection: $selection,
content: { item, _ in
VStack {
IconDeprecated(.circle)
Text(item)
}.padding()
})
IconDeprecated(.activity)
Row("Title")
SegmentedPickerSelector(items, selection: $selection) { item, _ in
Text(item)
}
Select("Select", items, selection: $selection) { item, _ in
Text(item)
} selectionView: { selected in
Text(selected)
}
Surface(background: .secondary) {
Text("Text")
}
TextField("Text", text: $placeholder))
.textFieldStyle(.default)
}
更多信息请参阅 DocC 文档
本项目使用 SwiftLint 自动检查我们的 Swift 代码中常见的错误。在本项目中开发时,请按照 SwiftLint 安装说明 安装它。
OversizeUI 在 MIT 许可证下发布。有关详细信息,请参阅 LICENSE。