Created
September 1, 2020 11:20
-
-
Save Plnda/a3d8c8c86ea0a9dad4c33f8ae17ab6f3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ParallaxModifier: ViewModifier { | |
@ObservedObject var manager: MotionManager = MotionManager.shared | |
var magnitude: Double | |
func body(content: Content) -> some View { | |
content | |
.offset(x: CGFloat(manager.roll * magnitude), y: CGFloat(manager.pitch * magnitude)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment