UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Using UIInterpolatingMotionEffect within SwiftUI

Forums > SwiftUI

I want to use UIInterpolatingMotionEffect within SwiftUI. I was thinking to use the coordinator as a way to bridge between UIKit ans SiwftUI with no success. I want to change the amount of shadow of a rounded rectangle depending on the tilting of the iPhone. Any idea to achive this. Maybe it is possible to get the underlying UIVie for this.

2      

I just started looking into this kind of thing today to create shimmering text based on phone tilt. I found a tool that lets you add parallax movement to any SwiftUI view which might help you out as well. It uses UIViewController and UIViewControllerRepresentable

https://github.com/Priva28/ParallaxSwiftUI

2      

Actually, this is way easier and performs a lot better:

https://trailingclosure.com/device-motion-effect/

2      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.