![]() I was pretty far into this when I accidentally stumbled across a Stack Overflow comment noting that SwiftUI actually does have a native paging view – it’s just cleverly hidden as a TabView style! srsly? Still, though, nothing about this approach felt right.Įventually I decided that maybe I should just wrap a UIScrollView to accomplish what we needed and started to dive into that. I started going down the road of adapting one of the better ones with more correct physics after I discovered this gem of a project which meticulously deconstructed the formulas necessary to get an Apple-like scroll view feeling. ![]() The swipes didn’t have the same momentum that Apple uses everywhere else and the resistance on the rubber band effect (if it even had it) was never quite right. The most glaring problem with them tended to be that the scrolling physics felt entirely wrong. I tried a few different open source paging view implementations I found on GitHub but they were all lacking in one way or another. Did I really need to do all of this myself from scratch? I ran across a bunch of tutorials that were manually implementing panning gestures and paging and I was flabbergasted. In UIKit it’s trivial to enable paged mode on a UIScrollView to get this behavior, but I couldn’t find a way to do it in SwiftUI for some reason. The biggest surprise for me was how much trouble I had implementing the paging view to swipe left and right between wallpaper variants. In the last post, I talked about overcoming some issues with Wallaroo‘s main gallery view, but unexpectedly even the simple wallpaper detail screen held its share of challenges!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |