Ole Begemann 11/24/2022

clipped() doesn’t affect hit testing

Read Original

This technical article details a SwiftUI behavior where the clipped() modifier visually hides out-of-bounds content but does not restrict the view's hit-testing area. It demonstrates the issue with code examples, shows how it can make other UI elements untappable, and provides the solution using the contentShape() modifier to align hit testing with the visible bounds.

clipped() doesn’t affect hit testing

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week