Ancestors

Toot

Written by David Smith on 2024-11-22 at 16:13

1/ There is something deeply comforting when you struggle all day trying to find a solution for a problem only to discover that Apple couldn't/didn't solve it either.

I was trying to create a SwiftUI chart which could smoothly animate between different zoom levels (month, week, year) while keeping the users viewport on a similar date range. I'm pretty sure this isn't possible (even with the new iOS 18 scrollview stuff).

You can sort of get it in on the ends but not smoothly everywhere.

=> View attached media

=> More informations about this toot | More toots from _Davidsmith@mastodon.social

Descendants

Written by David Smith on 2024-11-22 at 16:14

2/ I remembered Apple Health has a similar view, so I checked how they did it (realizing it might be a UIKit UIScrollView thing which would give you way more control).

Analyzing slo-mo footage of their switching I discovered they actually just kinda "cheat" and swap out a replacement chart which either animates from slightly wider or narrower than the final result. Which is a delightfully clever approach to a really tricky problem. Visually similar to a full solution but much simpler.

[#]##

=> View attached media

=> More informations about this toot | More toots from _Davidsmith@mastodon.social

Written by Adam Garrett-Harris on 2024-11-22 at 16:32

@_Davidsmith ai wonder if there's something like D3.js, but for SwiftUI

=> More informations about this toot | More toots from agarrharr@mstdn.social

Written by Jonathan Peacher on 2024-11-22 at 16:34

@_Davidsmith I too have recorded slow videos of apps to reverse engineer how they do certain animations 👌🏼

=> More informations about this toot | More toots from djpeacher@fosstodon.org

Written by Kevin Conner on 2024-11-22 at 16:58

@_Davidsmith Worse is Better :)

=> More informations about this toot | More toots from easeout@mastodon.social

Written by Bruce on 2024-11-22 at 17:04

@_Davidsmith Reminds me of Android's MaterialSharedAxis transition. I love how a subtle animation can do so much! This probably originated with older Android phones not being able to do long fullscreen animations smoothly but this is so much a "less is more" for me.

=> View attached media

=> More informations about this toot | More toots from bgeerdes@mastodon.cloud

Written by Robert Carlsen on 2024-11-22 at 17:26

@_Davidsmith Interactive Charts in Health long predate SwiftUI :)

=> More informations about this toot | More toots from technophobe@mastodon.xyz

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113527489024930235
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
399.845006 milliseconds
Gemini-to-HTML Time
1.478295 milliseconds

This content has been proxied by September (ba2dc).