r/iOSProgramming • • 3d ago

Article I am creating animated widgets.

Hey all!

I’m building Jubs, an app with animated iPhone widgets.
I want them to feel alive, and a big part of that is getting the little details right.

I draw everything by hand first, then write simulations to figure out how it should move.
For this snow globe, that meant working out how snow falls and how the curved glass bends what you see through it.

Let me know your thoughts, please.

Thank you

7 Upvotes

24 comments sorted by

2

u/jaymakesapps 2d ago

Simulating how curved glass bends the snow for a home screen widget is a beautifully unhinged amount of effort. Good timing on the snow globe though, December basically sells it for you.

1

u/tedmirra 2d ago

Thank you, it took me several attempts to get to this point, and I am not 100% fully happy with it...

I hope you are right on the selling part šŸ™

2

u/brkaydev 2d ago

Worth checking it in the tinted and clear home screen styles too. There the system renders widgets in accented mode, and a hand drawn image can end up as a flat grey shape unless you set widget accented rendering mode on it (full color or desaturated) and pick which layers take the accent. Snow and glass highlights are exactly the kind of detail that disappears in that mode.

1

u/tedmirra 2d ago

oh!! Great catch!! Yes, I need to check that too.
Thank you

2

u/purposeful_pineapple 2d ago

Why does the box go all around the tree, but the candy cane just bobs to the side without ever crossing the front?

1

u/tedmirra 2d ago

I thought about it, and I accept it, but now that you mention it, it makes sense for them to go around and maybe touch each other.

2

u/definitelybestguy 2d ago

I can see you've tried this on device, but curious how long you've run it for? I suspect this kind of refresh rate will consume your widget's day's refresh budget in minutes, and then it will end up sitting static the rest of the time... Would love to be wrong about this as I've had a few ideas which would benefit from even this 1 fps refresh rate animation, but I didn't think it was possible.

1

u/tedmirra 2d ago

It works all day; everything here is like a clock. Imagine the pointers are the gift, candy cane and snow.

You can try the V1 here: https://apps.apple.com/us/app/jubs/id6821070839

2

u/definitelybestguy 1d ago

Well, just as I said, I'm loving being wrong about this! Very cool, TIL!

1

u/tedmirra 1d ago

Thank you!

1

u/wwwery-good-apps 2d ago

You're right for a normal widget, that's 40 to 70 reloads a day. But reloads don't count while the app has an active audio session (it's in Apple's "Keeping a widget up to date" doc). My emulator app plays the game sound in the background and just spams reloadAllTimelines, I got up to 40 a second on the home screen and could play Mario Kart in the CarPlay dashboard widget. Phone gets warm fast though, then it drops to around 16.

1

u/definitelybestguy 1d ago

Very good to know, thanks for the tip, I'll definitely take a look into this

2

u/wwwery-good-apps 2d ago

they are looking cool, how do you render them?

2

u/tedmirra 2d ago

Its using a trick, so basically this is a clock, the pointers are the items you see, each one moving at their own time.

1

u/hamsterjedi Swift 2d ago

While the idea is great, it looks laggy as hell? 🫠

1

u/tedmirra 2d ago

Yes, unfortunately, it's a drawback... because widgets are not supposed to animate... :/

2

u/[deleted] 3d ago

[removed] — view removed comment

1

u/tedmirra 2d ago

This is a good point! I need to check this out!

Thank you

1

u/redrufie 1d ago

Wasn't there a leaked function that wouldn't hurt battery life too much

1

u/[deleted] 8h ago

[removed] — view removed comment

1

u/AutoModerator 8h ago

Hey /u/momentpressapp, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.