Create a new SwiftUI file called ProfileView.
In the ProfileView file, create a basic view with the necessary elements for the user profile. For example, you may want to include an image view for the user's profile picture and a text view for their name and bio.
In the NavigationView of the main view, add a NavigationLink to the profile icon image with the destination parameter set to the ProfileView:
NavigationView {
VStack {
// content of main view
NavigationLink(destination: ProfileView()) {
Image(systemName: "person.circle")
.font(.largeTitle)
.foregroundColor(.primary)
}
}
}
Asked: 2021-08-25 11:00:00 +0000
Seen: 11 times
Last updated: Nov 05 '22