SwiftUI Bug (or Feature?) in iOS 18
? Dima Bronnikov
Senior iOS Developer | 10+ years of experience | Swift, Obj-C, SwiftUI, UIKit
I wanted to share a quick tip for anyone encountering the same issue I faced while working on my latest SwiftUI project.
Here’s the problem: I had a simple SwiftUI view with a List and a custom Button in a HStack. Here’s what the code looked like:
When running on iOS 18, the Button stopped recognizing tap gestures. After some digging, I found out that it’s due to a new behavior in SwiftUI: parent views can block child view gestures.
You can work around this by explicitly assigning a higher priority to the tap gesture on the view.
Projektmanager, Coder und Writer | #lachen #wandern #mopedfahren
1 个月thx for sharing. had a similiar problem with ios18 probably belonging to the same category. my parent view uses double-tap with a child using single. starting with 18 responsiveness went bad: had to tap the child rather long. discussion attached led to recent changes made by apple (well-thought, of course...). unbreakable optimistic, i hope on a fix. until then, i changed the parent from double- to long-tap... https://developer.apple.com/forums/thread/765559?answerId=809164022#809164022
Titi token j?n hülyék
Full stack developer | 7 years+ | React, RxJs, Typescript, Nest.js, Node.js, .Net, SQL
4 个月Good to know.
Tech Entrepreneur | Team Lead & Software Engineer | Author & Speaker | Follow for daily posts about Mindset, Personal Growth, and Leadership
4 个月Love this
Data Engineer | 5+ years | PepsiCo | Databricks, Apache Spark, Microsoft Azure
4 个月Very valuable info!