TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

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 Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

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.