April 2020
Beginner
316 pages
8h 20m
English
Finally, let's take a look at how well the rotation3DEffect works. Head on over to AddRecipeView.swift and find the Button and Image view that we use to choose an image from our library.
Make the following highlighted changes:
Button(action: { DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) { self.showingImagePicker.toggle() } self.angle = self.angle == 360 ? 0 : 360}) {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)}.rotation3DEffect(.degrees(angle), axis: (x: 0, y: 1, ...Read now
Unlock full access