one time someone gave me a compliment that “[my iOS app’s] sheet physics were perfect” (if you know, you know)
i was flattered, but the truth was actually cooler than mimicking the physics perfectly.
The Challenge with iOS Sheets
iOS devs have had a love/hate relationship with Apple’s sheet/drawer component because it has some weird limitations (like the same screen can’t present more than one sheet at a time).
this has led many developers to build custom sheets for their apps even to replicate the UX of system apps (like Maps). but: there are a bunch of tiny details about how the system version works - animation curves, gesture responses, physics - and if they don’t match exactly yours will feel “off”.
so how did i get mine right?
the answer was simple: i was actually using a native sheet 🙈
so why did they think i was using my own version? because i was very clearly presenting more than one sheet from the same screen, which as i said earlier, doesn’t work.
unless… 🤔
Enter UIWindow
there’s a component on iOS called a window, and it’s just like a window on your computer. iOS copied a lot of the underlying functionality from macOS when it was built, including the concept of multiple windows.
most iOS developers don’t need to use windows for their apps, and i’d guess many don’t even realize you can have more than one window. we tend to think about the “screen” in apps, not the window that the screen is showing, because they’re often 1:1.
returning to my implementation. it probably would’ve been easier to build my own custom sheet, but i felt like that would lead to a weird “almost native” feel. i wanted this app to feel right at home with the built-in apps. like it was built by Apple, but better.
so i did it the hard way: i added a second window to my app that would float over the rest of the app and show a sheet. it could be accessed from any screen while not preventing other sheets throughout the app (perfect use for a window).
because i used a built-in sheet, its continued to “feel right” even as Apple has updated iOS, and the various default animation timings and curves that can make or break how things feel (often subconsciously).
Details Matter
app development is full of these types of problems that people will only notice if you get it wrong. if it feels “right”, the assumption is that it’s built-in functionality, even if it took days or weeks of careful tweaking, tuning, and building to nail it.
i don’t share any of this to complain, i’ve been building iOS apps since iPhone OS 2.0 in 2008, and it’s been the best job ever! making things that people love to use every day is awesome, and i hope i can keep doing it for many more years.
if you made it this far and want to check out the app for yourself, it’s available for free on the App Store.
let me know if you have any questions or feedback. thank you, and enjoy!