Learning Time : 50min
My Github : Source Code
NavigationView
so we can show our app’s name at the top.struct ContentView: View {
@State private var image: Image?
@State private var filterIntensity = 0.5
var body: some View {
NavigationView {
VStack {
ZStack {
Rectangle()
.fill(.secondary)
Text("Tap to select a picture")
.font(.headline)
.foregroundColor(.white)
image?
.resizable()
.scaledToFit()
}
.onTapGesture {
// Add code to select an image
}
HStack {
Text("Intensity")
Slider(value: $filterIntensity)
}
.padding(.vertical)
HStack {
Button("Change filter") {
}
Spacer()
Button("Save", action: save)
}
}
.padding([.horizontal, .bottom])
.navigationTitle("Instafilter")
}
}
func save() {
}
}