Skip to content

Instantly share code, notes, and snippets.

⚡️
Get shit done!

Christian Aranda WildStudio

⚡️
Get shit done!
Block or report user

Report or block WildStudio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@WildStudio
WildStudio / Custom frame
Last active Sep 4, 2019
SwiftUI - Customising the frame in our indicator
View Custom frame
struct ContentView: View {
var body: some View {
VStack {
Text("SwiftUI")
Indicator()
}.frame(width: 150, height: 100, alignment: .center)
}
}
@WildStudio
WildStudio / Adds padding to trailing
Created Sep 4, 2019
SwiftUI adding padding to trailing
View Adds padding to trailing
truct ContentView: View {
var body: some View {
HStack {
Text("SwiftUI")
.padding(.trailing)
Text("Basics")
}
}
}
View Adding Padding to a view
struct ContentView: View {
var body: some View {
HStack {
Text("SwiftUI")
.padding(100)
Text("Basics")
}
}
}
View Two Text taking equal width
struct ContentView: View {
var body: some View {
GeometryReader { geometry in
HStack {
Text("SwiftUI")
.frame(width: geometry.size.width / 2, height: 100)
Text("Basics")
.frame(width: geometry.size.width / 2, height: 100)
}
}
@WildStudio
WildStudio / Provide spacing HStack init
Last active Sep 4, 2019
Adding Spacing and alignment inside your SwiftUI stacks
View Provide spacing HStack init
HStack (spacing: 100) {
VStack {
Text("WAMF")
Text("Tutorial")
}
VStack(alignment: .trailing) {
Text("SwiftUI")
Text("Basics")
}
}
@WildStudio
WildStudio / VStack - HStack
Created Sep 4, 2019
SwiftUI Layout Basics
View VStack - HStack
HStack {
VStack {
Text("WAMF")
Text("Tutorial")
}
VStack {
Text("SwiftUI")
Text("Basics")
}
}
View gist:3c9eadc4c26d169d5d6aee14604379a9
import SwiftUI
struct ContentView : View {
var body: some View {
Text("Hello World")
}
}
View gist:547bffa9562b1e97eb93580a3b2bd3bb
// Instantiate a new UIWindow with the size of our phone screen and assign it to the window property
let window = UIWindow(frame: UIScreen.main.bounds)
// Instantiate a UIHostingController which is a ViewController but it is capable of holding the new SwiftUI View.
window.rootViewController = UIHostingController(rootView: ContentView())
self.window = window
// Make the window key and visible. This is telling it is the active window.
window.makeKeyAndVisible()
View gist:252e87e7a1e806c68439f9adb20da36e
struct LoginView: View {
@State var username: String = ""
@State var password: String = ""
@State var authenticationDidFail: Bool = false
var body: some View {
VStack {
View gist:3ebb7ed6e7d3ff2a7d3d572aea994146
struct LoginView: View {
@State var username: String = ""
@State var password: String = ""
@State var authenticationDidFail: Bool = false
var body: some View {
}
You can’t perform that action at this time.