UI Frameworks

RSS for tag

Discuss the different user interface frameworks available for your app.

Posts under UI Frameworks tag

29 Posts
Sort by:
Post not yet marked as solved
2 Replies
1.2k Views
Good day together, I am already in despair, I would like to insert a button in the NavigationBar next to the NavigationBarTitle which also automatically shrinks or enlarges. The whole thing can be seen in the App Store under the menu item "search". There, when the user scrolls down, the search bar and the title is given as .inline but not the user button. I am currently trying to implement the whole thing in SwiftUI and can't find a solution. Is there already a solution for this or if someone has the exact documentation for this case I would be very grateful for it :). thank you very much!
Posted
by
Post not yet marked as solved
4 Replies
2.8k Views
In the "old" TextKit, page-based layout is accomplished by providing an array of NSTextContainers to NSLayoutManager, each with its own NSTextView. TextKit 2, NSTextLayoutManager allows only a single text container. Additionally, NSTextParagraph seems to be the only concrete NSTextElement class. Paragraphs often need to break across page boundaries. How would one implement page-based layout in TextKit 2?
Posted
by
sjs
Post not yet marked as solved
1 Replies
1.3k Views
I am trying to implement Quick Notes through SwiftUI, rather than UIKit or AppKit. I am unsure if the behaviour below is expected, or due to a bug. I have already successfully implemented NSUserActivity for Handoff, Spotlight and Siri Reminders, using the .userActivity() view modifier. These NSUserActivity instances use the NSUserActivity.userInfo dictionary to store and correctly restore the content through the .onContinueUserActivity(perform: ) methods. Quick Notes requires using the .persistentIdentifier or .targetContentIdentifier properties, rather than the .userInfo dictionary alone. However, when I set these either of these to unique identifiers using the code below, they are not correctly stored within the useractivity. MyView() .userActivity(ActivityString, updateUserActivity) private func updateUserActivity(_ activity: NSUserActivity) {     activity.isEligibleForSearch = true     activity.isEligibleForHandoff = true     activity.title = "Title"     activity.targetContentIdentifier = myItemUniqueID     activity.persistentIdentifier = myItemUniqueID     activity.userInfo = ["id": myItemUniqueID]     print(activity.targetContentIdentifier) // Correctly prints     print(activity.persistentIdentifier) // Correctly prints     print(activity.userInfo) // Correctly prints     } The identifiers print correctly when setting the user activity above. However, when restoring the user activity (tested through Handoff and Spotlight Search), the targetContentIdentifier and persistentIdentifier strings are empty. MyView()     .onContinueUserActivity(ActivityString, perform: continueUserActivity) private func continueUserActivity(_ activity: NSUserActivity) {     print(activity.persistentIdentifier) // Nil     print(activity.targetContentIdentifier) // Nil     print(activity.userInfo) // Correctly prints     } Is there something else I must do, or is this unexpected behaviour?
Posted
by
Post not yet marked as solved
2 Replies
1.1k Views
I am trying to use import from iPhone option as shown in WWDC session. I added code  WindowGroup {             ContentView()                 .environment(\.managedObjectContext, persistenceController.container.viewContext)                      }         .commands {             ImportFromDevicesCommands()         } ContentView.swift is  List {                 ForEach(items) { item in                     NavigationLink {                         Text("Item at \(item.timestamp!, formatter: itemFormatter)")                     } label: {                         Text(item.timestamp!, formatter: itemFormatter)                     }                 }                 .onDelete(perform: deleteItems)             }             .importsItemProviders([.image,.png,.jpeg,.rawImage], onImport: { providers in                 print("checking reachability")                 return true             }) The importsItemProviders block itself is not executed and not printing anything. In addition I am getting alert The operation couldn’t be completed. (Cocoa error 66563.) Is there anything to add for making this functionality work ?
Posted
by
Post not yet marked as solved
1 Replies
957 Views
In my application using UICollectionViewDiffableDataSource and compositional layout, I saw this exception Thread 1: "This solver does not handle estimated items so this method does nothing. Are you calling this in error?" that was thrown in dataSource.apply(snapshot, animatingDifferences: animated). I don't understand what it is telling me and how I should fix it. Any idea?
Posted
by
Post not yet marked as solved
2 Replies
1.4k Views
I'm reworking my app and update code and design. Because my app is one both iPhone and iPad, i'm using Splitview to handle the configurations. But my app has 4 section that I manage using a Tab bar and each tab has a SplitView. As you can see in images, the problem is that if I attach directly the UISplitViewController to UITabBarController you don't see two columns but only one (the primary or secondary view) both iPhone landscape orientation and iPad. A solution that I found is to attach the splitviewcontroller to a view that contains a ContainerViewController e connect the split view to this container. If you do this, you see the split view work correctly ma the problem is the customization of appearance (look at image 3) So may questions are: why I have to embed a split view in a container view controller and i can't connect it directly to tabbar as we done until now? Is there an other better solution then put a split view in a containerView? Thank you )
Posted
by
Post not yet marked as solved
5 Replies
1.5k Views
In iOS 15 SDK you added the new FocusState API in SwiftUI. However there is no discussion or explanation anywhere that I could find, which explains: What exactly is "focus"? What isn't focus? What is the relationship between FocusState and accessibility focus? What is the relationship between whether a SecureField is being edited, and whether it's "focused"? Example: Lets say my tvOS app has an on-screen keyboard, where the user uses the remote's directional controls to move focus around to the letter buttons. To enter their password, they focus the password field, then click the center button to activate it. Now that it's active, they move focus to each letter of their password and click on each one: P... A... S... S... W... R... D... !... then they move focus to the "Submit" button and click. In this case, while the SecureField is being edited, focus moves around to a bunch of different buttons. The point of this example is that, if SecureField had a public "isBeingEdited" property, then it would be TRUE even while the field is not focused. However most Workday's designers interpret "focused" as being totally equivalent to "isBeingEdited" because in a web browser, tabbing out of a field makes it stop being edited. What is Apple's intent here? When not using a remote or physical keyboard or screen-reader, how is focus supposed to relate to whether a field is being edited? Does this relationship change when a user now has a bluetooth keyboard connected and Full Keyboard Access is turned ON? How does this correlate with accessibility focus? I cannot find any documentation from Apple that explains what focus is, or how this is supposed to work in SwiftUI in the various different scenarios where the concept of "focus" is relevant. Do you have a link to something current that explains how it's supposed to work so that we will know if there's a bug? Last question: how can we make the iOS simulator treat the physical keyboard as if it was a bluetooth keyboard to be used for focus-based keyboard navigation?
Posted
by
O_G
Post not yet marked as solved
1 Replies
2.6k Views
I have made an UICollectionView in which you can double tap a cell to resize it. I'm using a CompositionalLayout, a DiffableDataSource and the new UIHostingConfiguration hosting a SwiftUI View which depends on an ObservableObject. The resizing is triggered by updating the height property of the ObservableObject. That causes the SwiftUI View to change its frame which leads to the collectionView automatically resizing the cell. The caveat is that it does so immediately without animation only jumping between the old and the new frame of the view. The ideal end-goal would be to be able to add a .animation() modifier to the SwiftUI View that then determines animation for both view and cell. Doing so now without additional setup makes the SwiftUI View animate but not the cell. Is there a way to make the cell (orange) follow the size of the view (green) dynamically? The proper way to manipulate the cell animation (as far as I known) is to override initialLayoutAttributesForAppearingItem() and finalLayoutAttributesForDisappearingItem() but since the cell just changes and doesn't appear/disappear they don't have an effect. One could also think of Auto Layout constraints to archive this but I don’t think they are usable with UIHostingConfiguration? I've also tried: subclassing UICollectionViewCell and overriding apply(_ layoutAttributes: UICollectionViewLayoutAttributes) but it only effects the orange cell-background on initial appearance. to put layout.invalidateLayout() or collectionView.layoutIfNeeded() inside UIView.animate() but it does not seem to have an effect on the size change. Any thoughts, hints, ideas are greatly appreciated ✌️ Cheers! Here is the code I used for the first gif: struct CellContentModel { var height: CGFloat? = 100 } class CellContentController: ObservableObject, Identifiable { let id = UUID() @Published var cellContentModel: CellContentModel init(cellContentModel: CellContentModel) { self.cellContentModel = cellContentModel } } class DataStore { var data: [CellContentController] var dataById: [CellContentController.ID: CellContentController] init(data: [CellContentController]) { self.data = data self.dataById = Dictionary(uniqueKeysWithValues: data.map { ($0.id, $0) } ) } static let testData = [ CellContentController(cellContentModel: CellContentModel()), CellContentController(cellContentModel: CellContentModel(height: 80)), CellContentController(cellContentModel: CellContentModel()) ] } class CollectionViewController: UIViewController { enum Section { case first } var dataStore = DataStore(data: DataStore.testData) private var layout: UICollectionViewCompositionalLayout! private var collectionView: UICollectionView! private var dataSource: UICollectionViewDiffableDataSource<Section, CellContentController.ID>! override func loadView() { createLayout() createCollectionView() createDataSource() view = collectionView } } // - MARK: Layout extension CollectionViewController { func createLayout() { let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(50)) let Item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.8), heightDimension: .estimated(300)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [Item]) let section = NSCollectionLayoutSection(group: group) layout = .init(section: section) } } // - MARK: CollectionView extension CollectionViewController { func createCollectionView() { collectionView = .init(frame: .zero, collectionViewLayout: layout) let doubleTapGestureRecognizer = DoubleTapGestureRecognizer() doubleTapGestureRecognizer.doubleTapAction = { [unowned self] touch, _ in let touchLocation = touch.location(in: collectionView) guard let touchedIndexPath = collectionView.indexPathForItem(at: touchLocation) else { return } let touchedItemIdentifier = dataSource.itemIdentifier(for: touchedIndexPath)! dataStore.dataById[touchedItemIdentifier]!.cellContentModel.height = dataStore.dataById[touchedItemIdentifier]!.cellContentModel.height == 100 ? nil : 100 } collectionView.addGestureRecognizer(doubleTapGestureRecognizer) } } // - MARK: DataSource extension CollectionViewController { func createDataSource() { let cellRegistration = UICollectionView.CellRegistration<UICollectionViewCell, CellContentController.ID>() { cell, indexPath, itemIdentifier in let cellContentController = self.dataStore.dataById[itemIdentifier]! cell.contentConfiguration = UIHostingConfiguration { TextView(cellContentController: cellContentController) } .background(.orange) } dataSource = .init(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: itemIdentifier) } var initialSnapshot = NSDiffableDataSourceSnapshot<Section, CellContentController.ID>() initialSnapshot.appendSections([Section.first]) initialSnapshot.appendItems(dataStore.data.map{ $0.id }, toSection: Section.first) dataSource.applySnapshotUsingReloadData(initialSnapshot) } } class DoubleTapGestureRecognizer: UITapGestureRecognizer { var doubleTapAction: ((UITouch, UIEvent) -> Void)? override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) { if touches.first!.tapCount == 2 { doubleTapAction?(touches.first!, event) } } } struct TextView: View { @StateObject var cellContentController: CellContentController var body: some View { Text(cellContentController.cellContentModel.height?.description ?? "nil") .frame(height: cellContentController.cellContentModel.height, alignment: .top) .background(.green) } }
Posted
by
Post marked as solved
3 Replies
2.1k Views
I have a full screen list and want to use the new keyboardLayoutGuide constraint, but by default it uses the safe area inset. How can I disable this so my list goes all the way to the bottom of the screen when the keyboard is not shown? NSLayoutConstraint.activate([ collectionView.topAnchor.constraint(equalTo: view.topAnchor), collectionView.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor), collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor), collectionView.trailingAnchor.constraint(equalTo:  view.trailingAnchor) ])
Posted
by
Post not yet marked as solved
0 Replies
895 Views
I'm specifically talking about macOS because the others are very different beasts. Since, well literally the first release of OS X 10.0, there has not been a coherent automation framework on the Mac. The last OS to offer that was Mac OS 9.X To define terms, by coherent, I mean from the command line environment up through the user interface. A single, coherent automation framework that is usable across the entire OS, ala PowerShell on windows. That doesn't exist for current macOS, nor has it ever existed for any variant of macOS since again, Mac OS 9.X At best it has been a pastiche of completely different frameworks, operating modalities and languages all desperately trying to work together via osascript and do shell script. That any of it works at all is like a talking dog: the fact the dog talks is a miracle, bad grammar is minor. Yes, I know Shortcuts exist, but shortcuts are a developer managed bit of pseudo-automation. If I limit myself to Shortcuts, then I have little to no ability to do anything beyond what the developer of that application chooses to allow me to do. For example, at least as of Ventura, Dictionary, Font Book, iMovie and others have no shortcuts. I can't create my own shortcut for those apps, the devs have to do that. (the fact that Apple is not flooding us with Shortcuts shows how little Apple cares as a company about this. Individual teams wax good and bad, but clearly, Apple doesn't think dogfooding here is important.) (Note: if your only comment is to ask why anyone would care about automating , that's absolutely not the point. The idea is to make it possible for everyone, not just developers, to create in ways no one can predict outside of an application's constraints.) "Well, there's always AppleScript/JXA" I will not write down the laughter here, but there is laughter. As of Ventura, there are no less than 32 Apple applications with no scripting dictionary at all, so neither AppleScript/JXA can work. You might be able to use UI scripting, but no guarantee there, and UI scripting is a fragile thing, at best suited to a last resort option. Again, Apple could lead the way, they choose not to. But that's only the UI levels. Below the UI, then there's no coherency at all. You're stuck with shell scripts and whatever a given utility's author chose to allow, and sharing data and information is no better than at the UI level, and neither the command line level nor the UI level know the other exists. The only way to combine the two is again: Do Shell Script Osascript That is not a coherent automation framework. Then of course, there's the lack of documentation. AppleScript has inherited at least the language guide, which is well-written and usable, but the command line level has man pages. Which are the most inconsistent things. Some utilities' man pages are remarkably useful, others don't even have man pages. At all. Other utilities man pages have syntax errors for the command that brings up the help page and that is all the man page does. Ponder the disconnect there: --help provides detailed usage information that is not in the man page. The man page says use ---help which is bad syntax. This seems odd, but why is the --help output not also in the man page? Is that not the purpose of the man page? Man page inconsistencies aside, Apple developer support has only ever barely acknowledged automation/scripting and really never supported it except for accidentally. Even in a language like AppleScriptObjecttiveC, (ASOC) which one can use for real apps in the MAS, the response from DTS for help was "use the mailing list." (not that DTS is that good anyway, I had an issue with CoreWLAN in ventura, and have since been ghosted on any notification that the OS bug that was causing me problems has been fixed. Maybe it has, maybe it hasn't. I can test for it, but why did DTS ghost an actual SwiftUI issue for an app written in Swift? ¯_(ツ)_/¯ This is a solveable problem, Microsoft has solved it in terms of language, documentation and coherency, with PowerShell. Leaving aside architectural issues that make it almost impossible to properly secure windows, the way MS treats PowerShell is the example. Windows as an OS has excellent support for automation, the documentation for PowerShell is amazing, (the documentation for a scripting language is better than Apple's entire developer docs, which is just inexcusable.) The difference between automating either platform is night and day, and in a race with two horses, Apple is a distant fifth. The language syntax here is almost a non-issue. In fact, I think using a "powershell'd" version of Swift would be an excellent idea. Create a simpler version of swift in the way PowerShell is a simpler version of C#. Make it so if you need to call a framework outside of the main automation framework, you can do so with ease, ala PowerShell. For example, PowerShell has no GUI primitives the way AppleScript does, so to create a file choose browser in PowerShell, you instead invoke the correct .NET framework: Add-Type -AssemblyName System.Windows.Forms $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') } $null = $FileBrowser.ShowDialog() Ironically, you can do this with ASOC, but only for items that have ObjC interfaces, which will be shrinking. Having a coherent automation framework with a primary language that allows people using it to more easily use "full" Swift and its frameworks as needed is a force-multiplier for Apple. It would help people do more with macOS and maybe other platforms depending on implementation, not less. It would not force people to beg the developers of their apps to write Yet Another Shortcut to do this thing that they can't do, (or have to do the dance to convince the dev that their need is worth the trouble), and it would allow people to solve their problems in their own ways for their own needs. But, it requires Apple to care about this at all, and that is where the problem is. This is fixable, Apple has the resources to fix it, what they lack is interest and desire. But creating and fully supporting a proper automation framework would add so much to macOS and the other platforms by extension that there's no logic behind not doing so. Maybe next year. (in the best lol of all, you can't even create an automation tag for a post. sigh.)
Posted
by
Post not yet marked as solved
0 Replies
822 Views
Hi everyone i have an app that has some related entities. throught the different type of tutorial i see that apple incourages to use relationship and inverse relationship in the core data model, and that what i have done. Now, when i reach the point that a user wants to share one particular entity to other users, the inverse relationship spread the share to all the graph of core database shouldn't the inverse relationship be ignored by the share process? if i want to share only that record and the child, not the parent one, should i break the realtionship with the parent (that for me is the inverse relationship) imposing it to a nil value?
Posted
by
Post marked as solved
1 Replies
871 Views
I've been trying to disable the "Smart Selection" feature introduced in https://developer.apple.com/wwdc20/10107 from a PKCanvasView. This feature could be very useful for some apps but if you want to start from a clean state canvas it might get in your way as you add gestures and interactions. Is there any way to opt out from it? The #WWDC20-10107 video demonstrates the "Smart Selection" feature at around 1:27.
Posted
by
Post not yet marked as solved
1 Replies
780 Views
I know this is far after the fact, but in going through the Widgets Code-along, part 2: Alternate timelines code-along, and having done very little SwiftUI, I ran into an issue that I can't seem to figure out. Things like this are one of the biggest reasons I haven't even considered migrating any of my apps to SwiftUI - I just can't get the UI to look the way I want it to. The code in question is very simple: Just a couple of things inside an HStack. For some reason, they added a ZStack around that (the HStack is the only thing inside it), and that ZStack changes the font size of one of the two HStack contents very slightly. For some reason. I'm really not sure why they bothered with the ZStack - it only has one thing inside it. Anyway, the code looks like this: HStack(alignment: .top) { AvatarView(entry.character) .foregroundColor(.white) Text(entry.character.bio) .padding() .foregroundColor(.white) } .padding() .widgetURL(entry.character.url) } .background(Color.gameBackground) .widgetURL(entry.character.url) And on the Panda hero (the only one Izzy demos), it looks fine. But The problem is with literally any other hero - they all have bios that are longer than Panda's, and they all clip their contents. If I put a background or a border on the Text(), it's very clear that while the left side (the AvatarView) takes up the whole height of the widget, the Text does not. That makes sense if its contents are small, but in most cases, the contents are substantially larger, and they clip, while leaving a bunch of blank space underneath. Obviously, that's just simply unacceptable from a UI perspective, and I haven't been able to figure out which of the modifiers I can put on Text will correct this - if any. I'm excited about the potential of SwiftUI to simplify what can often be huge storyboards, but things like this (******, little, should-be-easy things being effectively impossible) make me think that it's not worth the hassle. I did do web searches, including looking on StackOverflow, but what do you even search on for things like this? The terms I searched on, at least, bore no fruit. Thanks in advance for any help you can offer.
Posted
by
Post not yet marked as solved
0 Replies
625 Views
I've been trying to save a selected color with UserDefaults from UIColorPickerViewController. But I run into a color space fiasco. Anyway, here come my lines of code. class ViewController: UIViewController, UIColorPickerViewControllerDelegate { @IBOutlet weak var imageView: UIImageView! @IBAction func selectTapped(_ sender: UIButton) { let picker = UIColorPickerViewController() picker.delegate = self picker.selectedColor = .yellow picker.supportsAlpha = false present(picker, animated: true, completion: nil) } override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if let color = UserDefaultsUIColor.shared.readColor(key: "MyColor") { print("Color being read: \(color)") } } func colorPickerViewControllerDidFinish(_ viewController: UIColorPickerViewController) { let color = viewController.selectedColor print("Selected color: \(color)") UserDefaultsUIColor.shared.saveColor(color: viewController.selectedColor, key: "MyColor") } func colorPickerViewControllerDidSelectColor(_ viewController: UIColorPickerViewController) { imageView.backgroundColor = viewController.selectedColor } } class UserDefaultsUIColor { static let shared = UserDefaultsUIColor() func saveColor(color: UIColor, key: String) { let userDefaults = UserDefaults.standard do { let data = try NSKeyedArchiver.archivedData(withRootObject: color, requiringSecureCoding: false) as NSData? userDefaults.set(data, forKey: key) } catch { print("Error UserDefaults: \(error.localizedDescription)") } } func readColor(key: String) -> UIColor? { let userDefaults = UserDefaults.standard if let data = userDefaults.data(forKey: key) { do { if let color = try NSKeyedUnarchiver.unarchivedObject(ofClass: UIColor.self, from: data) { return color } } catch { print("Error UserDefaults") } } return nil } } I first start out with a yellow color (UIColor.yellow). And I select a color whose RGB values are 76, 212, 158, respectively. And the color picker guy returns the following. kCGColorSpaceModelRGB 0.298039 0.831373 0.619608 1 And I get the following in reading the saved color data object. UIExtendedSRGBColorSpace -0.270778 0.84506 0.603229 1 How can I save and read color data objects consistently? I could specify a color space when I save a color. But it doesn't go well. Muchos thankos Señor Tomato de Source
Posted
by
Post not yet marked as solved
0 Replies
460 Views
Yes, I know WWDC21 was a long time ago but here it is August 2023 and I am looking at the "Building a Great App with SwiftUI. Following along with the Session 1 and 2 videos, I get to the part where you add an Export command. Only, the Export dialog does not appear. The "completed" session 2 source also fails to display an Export dialog. In fact there appears to be no definition for an Export view. I've searched the web, including the Apple forum, for this problem but it looks like no one has encountered this bug. Did anyone ever get this Great App to work?
Posted
by
Post not yet marked as solved
2 Replies
714 Views
I keep getting random crashes, when attempting to reconfigure an existing item. I check immediately for that if the item identifier exists in the data source and do not attempt to configure it if it's not. This is there error message: "Attempted to reconfigure item identifier that does not exist in the snapshot: ..." Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x9cb4 __exceptionPreprocess 1 libobjc.A.dylib 0x183d0 objc_exception_throw 2 Foundation 0x4e154c _userInfoForFileAndLine 3 UIKitCore 0xa44a8 -[__UIDiffableDataSourceSnapshot _validateReloadUpdateThrowingIfNeeded:] 4 UIKitCore 0xa2ed8 -[__UIDiffableDataSourceSnapshot _commitUpdateAtomic:] 5 UIKitCore 0x561048 -[__UIDiffableDataSourceSnapshot reconfigureItemsWithIdentifiers:] 6 libswiftUIKit.dylib 0x35d0c NSDiffableDataSourceSnapshot.deleteItems(_:) 7 Trulia 0x45380c closure #1 in ActivityFeedV3ViewController.updateUI(for:) 8 Trulia 0x4c4f58 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
Posted
by
Post not yet marked as solved
0 Replies
442 Views
I'm trying to understand the mechanism by which the Quit Application menu item gets disabled while a modal dialog/alert is up. Who is responsible for disabling the menu item? We have a case where in some cases, the Quit Application menu item is not getting disabled even when a modal dialog is up. So I'm trying to figure out where things may be going wrong.
Posted
by
Post not yet marked as solved
5 Replies
2.2k Views
After Updating my app to iOS 17.0 I noticed some odd behavior when swiping a detail view away with a parent view that has a toolbar with a ToolbarItem(placement: .bottomBar). As the user starts a leading swipe gesture to navigate back to the previous view the parent navigation title strangely animates to the center and the leading nav bar button disappears. If the user stops this gesture at any point before completing the swipe they will be stuck in the detail view as the leading nav button has disappeared. This only seems to be an issue if one attempts to swipe back to the parent view and not when the leading nav button is tapped. The following is the minimum code to reproduce this issue for me. I am testing on a physical device on iOS 17.0 with Xcode Version 15.0 (15A240d). struct ToolbarIssueView: View { var body: some View { NavigationStack { NavigationLink { Text("Detail View") .navigationTitle("Detail") } label: { Text("To Detail View") } .toolbar { // This seems to cause strange behavior ToolbarItem(placement: .bottomBar) { Text("Bottom Bar Content") } } .navigationTitle("Main") } } } I understand that this bottom bar could easily be replaced with a .safeAreaInset(edges: .bottom) but I would prefer to use the more standard ToolbarItem(placement: .bottomBar). If anyone has any fixes for this issue or know what I am missing I would love to hear it!
Posted
by