This repository has been archived. It is now a part of PhantomKit.
A collection of useful SwiftUI components.
UIUtils is available as a Swift Package.
import UIUtils
ActivityIndicator()
.frame(width: 50)
.foregroundColor(.orange)
NavigationView {
BackgroundNavigationLink(
destination: Text("Destination"),
action: { print("Navigating...") },
content: Text("Go to...")
)
}
LabelButton(text: "Label", imageName: "plus.circle.fill", color: .red)
NetworkImage(url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"))
NetworkImage(
url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"),
loadingContent: Text("Loading..."),
errorContent: Text("Error")
)
@State private var selection = 2
// ...
PageView(selection: $selection) {
Text("Tab 1")
Text("Tab 2")
Text("Tab 3")
}
@State private var selection = 2
let items = (1 ... 5)
.map {
PickerItem(
selection: $0,
short: "Short: \($0)",
long: "Long text of: \($0)"
)
}
// ...
NavigationView {
Form {
SplitPicker(selection: $selection, items: items, showMultiLabels: true) {
Text("Picker")
}
}
}
@State private var selection = 1
// ...
TabView {
Text("Tab 1")
.tabItem(index: 1, text: "Calendar", imageName: "calendar")
Text("Tab 2")
.tabItem(index: 2, text: "Add", imageName: "plus.circle")
Text("Tab 3")
.tabItem(index: 3, text: "Cancel", imageName: "xmark")
}
.tabSelection($selection)
WebView(link: "https://google.com", blockOutgoingRequests: true)
UIUtils is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 1 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics