I used animation in these codes, and there was warning like "'animation' was deprecated in iOS 15.0: Use withAnimation or animation(_:value:) instead."
I am beginner, so please tell me how to fix it specifically.
struct ContentView: View {
@State var image: Image?
@State var isPicking = false
var body: some View {
ZStack {
VStack {
VStack {
Spacer()
image?
.resizable()
.scaledToFit()
Spacer()
}
HStack {
Spacer()
Button(action: {
self.isPicking = true
}) {
Image(systemName: "camera")
Text("カメラ")
}.padding()
}
}
if isPicking {
ImagePicker()
.edgesIgnoringSafeArea(.all)
.transition(.move(edge: .bottom))
.animation(.easeInOut)
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}