![]() Tapping the plus icon presents a sheet with a form. If you know a better way, please let me know! We will create a Navigation View with a plus icon. ![]() I somehow expect SwiftUI to be smart enough to handle it because the pattern is so common. I’ve found a way to fix it, but because I’m still new to SwiftUI, I don’t know if that’s the right way. The first is that you might find the + button really hard to tap, because whereas UIKit extends the tappable area to make it easier to interact with SwiftUI does not, so you need to tap exactly on the +. Two SwiftUI glitches might affect you while following along, depending on which Xcode version you’re using. Paul Hudson writes about this in Creating books with Core Data on November 16th 2019: We’ll change it to 44 ✕ 44 which is much easier to tap on The plus button in a Navigation Bar has a default size of 18 ✕ 18 which is too small to tap on. Visually it looked okay, but the tap area was too small to actually trigger an action. The problem: When running the app on my iPhone, I’ve noticed that the button was simply too small to tap on. This is a very common design pattern for adding items, such as calendar events, alarms, or anything that could be stored in an Array, Set or Core Data Model. One of the first things I wanted to do in SwiftUI was to place a plus icon (+) in a Navigation Bar. To learn more about SwiftUI I recommend to start reading 100 days of Swift How to increase the tap area of icons in a SwiftUI Navigation Bar ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |