|
I'm trying to re-create my app, originally created UIKit and Objective-C back in 2009, using SwiftUI. I have a view animated like this:
And here is the animation code:
The question is: is it possible to achieve the same effect in SwiftUI? |
|
Sasha shares some ancient code then asks:
Yikes that Objective C code is scary, Saturn return-type stuff! It's a great advertisement for adopting SwiftUI! Is it possible? First it's hard to decode what the old code is doing. Lacking a full stellium, I'm left to guess that this code animates text to simulate it sliding on screen from the right side? For fun, you added some variables for delays? (Hint: save a JPEG of the animation and provide a link in your post!) But without even seeing a working sample, I'll go out on a limb and suggest you look at examples using With a bit more retrograde it could be similar to the @twoStraws wrote a decent article about See -> Slick Transition |
|
|
|
Unfortunately, I don't have a clear idea of the details of how this code works, but I was able to reproduce it in my project. |
|
Sasha found a solution in another web site, but stopped short of understanding it.
Don't give up! This is a learning forum. Try the Rubber Duck 🐤 technique. I've pasted the magic part of the code below. So, grab a piece of paper and draw for yourself. The magic occurs with the These two transitions work together making a smooth motion animation.
|
SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.
Link copied to your pasteboard.