Created
March 16, 2020 20:49
-
-
Save dbolella/c2e8cdd1704fada5d24bf6ef287cc6d0 to your computer and use it in GitHub Desktop.
SwiftUI: Creating Custom Views and Manipulating Others
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
ProfilePage() | |
} | |
} | |
struct ProfileInformation: View { | |
var body: some View { | |
VStack{ | |
Text("Danny Bolella") | |
.font(.largeTitle) | |
Text("Awesome iOS Developer") | |
.font(.title) | |
Text("Danny loves SwiftUI and thinks it's the future of iOS Development!") | |
.font(.body) | |
} | |
} | |
} | |
struct ProfilePage: View { | |
var body: some View { | |
VStack { | |
Image("profilepic") | |
.resizable() | |
.aspectRatio(contentMode: .fit) | |
.clipShape(Circle()) | |
.overlay(Circle().stroke(Color.gray, lineWidth: 10)) | |
ProfileInformation() | |
} | |
.padding() | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment