April 2020
Beginner
316 pages
8h 20m
English
Back over in our AddReciepeView.swift file, add the following highlighted @State variables underneath our existing ones:
@State internal var ingredients = [String]() @State internal var showingImagePicker = false@State private var libraryImage: UIImage?
Now, add the following highlighted code just inside the start of your form (above the Add Recipe Name Text View):
Form { Image(uiImage: self.libraryImage ?? (UIImage(named: "placeholder-add-image") ?? UIImage())) .resizable() .aspectRatio(contentMode: .fit) .clipShape(Circle()) .overlay(Circle().stroke(Color.purple, lineWidth: 3).shadow(radius: 10)) .frame(maxWidth: .infinity, maxHeight: 230) .padding(6)
So, going line by line we've started by adding an Image View into ...
Read now
Unlock full access