Home > AI > IOS > SwiftUI >

rotation3DEffect

Example:

struct ContentView: View {
    @State private var ro: Bool = false
    
    
    var body: some View {
        Text("3D Rotate Effect")
        .padding()
        .border(Color.red, width: 1)
        .rotation3DEffect(.degrees(ro ? -90 : 90), axis: (x: 0, y: 1, z: 0))
        .animation(Animation.easeIn(duration: 2).repeatForever())
        .onAppear(perform: {
            ro = true
        })
    }
}

Leave a Reply