Skip to content

Instantly share code, notes, and snippets.

@dbolella
Created March 16, 2020 20:49
Show Gist options
  • Save dbolella/c2e8cdd1704fada5d24bf6ef287cc6d0 to your computer and use it in GitHub Desktop.
Save dbolella/c2e8cdd1704fada5d24bf6ef287cc6d0 to your computer and use it in GitHub Desktop.
SwiftUI: Creating Custom Views and Manipulating Others
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