Created
May 29, 2021 20:31
-
-
Save iosdevie/fd825ecaed39acf2addab6f00b8eda62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State var magnificationValue: CGFloat = CGFloat(1) | |
@State var rotationValue: Angle = .zero | |
var body: some View { | |
Rectangle() | |
.foregroundColor(Color.purple) | |
.cornerRadius(40) | |
.scaleEffect(magnificationValue) | |
.rotationEffect(rotationValue) | |
.frame(width: 200, height: 200, alignment: .center) | |
.gesture(MagnificationGesture() | |
.onChanged { value in | |
self.magnificationValue = value | |
} | |
.simultaneously(with: RotationGesture().onChanged { value in | |
self.rotationValue = value | |
})) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment