-
-
Notifications
You must be signed in to change notification settings - Fork 6
Examples
Zach Eriksen edited this page Mar 21, 2020
·
3 revisions
// MARK: Button Example
Button("Say Hello") {
print("Hello! 👋")
}
// MARK: Divider Example
HStack(withSpacing: 8) {
[
Label("Amount Left"),
Divider(.vertical),
Spacer(),
Label("4")
]
}
// MARK: Field Example
HStack {
[
field,
Button("Save") {
field.resignFirstResponder()
}
.frame(width: 60)
]
}
// MARK: Image Example
HStack(distribution: .fillEqually) {
[
Image(.blue),
Image(.green),
Image(.red)
]
}
// MARK: LoadingImage Example
LoadingImage(URL(string: "https://github.com/zmeriksen/SwiftUIKit/blob/master/assets/SwiftUIKit_logo_v1.png?raw=true")!)
.contentMode(.scaleAspectFit)
// MARK: LoadingView Example
LoadingView(forStyle: .large).start()
// MARK: MultiLineField Example
HStack {
[
multiLineField,
Button("Save") {
field.resignFirstResponder()
}
.frame(width: 60)
]
}
// MARK: NavButton Example
NavButton("Navigate to SomeVC",
destination: someViewController,
style: .push)
// MARK: ScrollView Example
ScrollView {
View(backgroundColor: .systemOrange)
.frame(height: 44, width: 1000)
}
// MARK: Slider Example
Slider(value: 0.5, from: 0, to: 1) { value in
print("Value is \(value)")
}
// MARK: Spacer Example
HStack {
[
Image(.brown).frame(width: 60),
Spacer(),
Image(.brown).frame(width: 60)
]
}
// MARK: Switch Example
Switch(isOn: false) { value in
print("Value is \(value)")
}
// MARK: WebView Example
WebView(url: URL(string: "https://github.com/oneleif")!)
This project is a oneleif active project.
Click on the link below to join the Discord server.
You will start with limited permissions, in a text channel that only moderators will see.
To get full access: read the rules, make an introduction in #introductions, and add an appropriate username.
When you're done with the above, shoot a message to the #start channel to let us know, and we will give you full access.
Feel free to email us at: [email protected]