Post

Replies

Boosts

Views

Activity

How to use Tab along with NavigationStack
Apple introduced Tab in iOS 18. Using the latest TabView APIs developer can add tab bar and side bar. However I need to control the navigation programmatically. For this I would add NavigationStack for each Tab. Would tab be a good practice? Or you have any other optimal solution?
1
0
437
Jun ’24
TabView doesn't show all tabs in tab mode.
Check my following code: struct ContentView: View { var body: some View { TabView { Tab("Firsttt", systemImage: "plus") { MainScreen(name: "First") } .defaultVisibility(.hidden, for: .sidebar) Tab("Seconddd", systemImage: "plus") { MainScreen(name: "Second") } .defaultVisibility(.hidden, for: .sidebar) Tab("Thirddd", systemImage: "xmark") { MainScreen(name: "Third") } .defaultVisibility(.hidden, for: .sidebar) TabSection { Tab("Third", systemImage: "plus") { MainScreen(name: "Third") } Tab("Fourth", systemImage: "plus") { MainScreen(name: "Fourth") } } header: { Label("Group", systemImage: "plus") } .defaultVisibility(.hidden, for: .tabBar) TabSection { Tab("Section 1", systemImage: "plus") { MainScreen(name: "Fourth") } Tab("Section 2", systemImage: "plus") { MainScreen(name: "Fourth") } Tab("Section 3", systemImage: "plus") { MainScreen(name: "Fourth") } } header: { Label("More", systemImage: "minus") } .defaultVisibility(.hidden, for: .tabBar) } .tabViewStyle(.sidebarAdaptable) } } My expectation is it would show three tab in tab mode. And two sections in sidebar mode. Side bar mode works as expected but tab bar shows only the first tab.
1
1
291
Jun ’24
Swift 6 actor error in didReceiveRemoteNotification of UIApplicationDelegate
From Xcode 16.0 Beta I am getting the following error at didReceiveRemoteNotification of UIApplicationDelegate protocol: Non-sendable type '[AnyHashable : Any]' in parameter of the protocol requirement satisfied by main actor-isolated instance method 'application(_:didReceiveRemoteNotification:)' cannot cross actor boundary; this is an error in the Swift 6 language mode Generic struct 'Dictionary' does not conform to the 'Sendable' protocol (Swift.Dictionary) How can I fix this warning before moving to Swift 6 mode.
2
1
827
Jun ’24