Super helpful, thank you! Do you have a recommendation about using a Navigation Stack with a TabView on iPad now? (Now that the tab bar is only at the top on iPad, the “back” being at the top when you’re within a stack of a tab seems confusing.)
This is an excellent and insightful video with comprehensive coverage on the possibilities of Tabview coming to iOS 18. It looks like lines are blurring between NavigationStack and TabView. Thanks Steve, exceptional as usual.
Great video. You're timing was just right for me. One follow-up question. Is there an approach whereby you can create the tabs dynamically using Swift data and still make the sidebar customizable?
Let me just start by saying your videos are amazing. The attention to detail is phenomenal. I learned so much. In regard to the TabView, if there's currently a way to hide TabSection headers in the TabBar view while keeping them visible in the Sidebar view, and more importantly, while still showing the tabs themselves in the TabBar. To be more clear I have a section and within those sections I have tabs. In sidebar view I can see the section and its Tabs, in the TabView I can only see the section or the first tab. Now is there a way to hide the section in the TabView and only shows its tabs?
You can hide a section from the Tab View, using .tabPlacement(.sidebarOnly) However, you cannot show the individual tabs by default. However, in the sidebar, when the user taps on one of the tabs in the section, it will appear on the tab bar after that. What you could do is set the tabPlacement for each of the items in the section as .pinned, but this will pin them to the end of the tab bar and only show the icon.
I have not found a way to do that. You can remove the sidebar altogether by using .tabViewStyle(.tabBarOnly) , but you do not get the option to bring it back
NOT WORKING: TabView(selection: $currentTab) { if #available(iOS 18.0, *) { Tab("Installed fonts", systemImage: "signature") { Text("Hello") } } else { // Fallback on earlier versions } } It says that "'buildExpression' is unavailable: this expression does not conform to 'View'"
You are mixing two different initializers so this won’t work. Bring the if #available outside the TabView. In iOS 18 the selection is set by a value not a tag. @State private var currentTab = 0 var body: some View { if #available(iOS 18.0, *) { TabView(selection: $currentTab) { Tab("Installed fonts", systemImage: "signature", value: 0) { Text("Hello") } } } else { TabView(selection: $currentTab) { Text("Hello") .tabItem { Label("Installed fonts", systemImage: "signature") } .tag(0) } } }
Next excellent lesson… special thanks for example in real project 🔥💯❤️
Thank you! I was searching for this exact tutorial! 🎉
Super helpful, thank you! Do you have a recommendation about using a Navigation Stack with a TabView on iPad now? (Now that the tab bar is only at the top on iPad, the “back” being at the top when you’re within a stack of a tab seems confusing.)
Awesome video, thank you Stewart!
This is an excellent and insightful video with comprehensive coverage on the possibilities of Tabview coming to iOS 18. It looks like lines are blurring between NavigationStack and TabView. Thanks Steve, exceptional as usual.
Glad you enjoyed it!
Great video. You're timing was just right for me. One follow-up question. Is there an approach whereby you can create the tabs dynamically using Swift data and still make the sidebar customizable?
You cannot dynamically add new views for the tabs
@@StewartLynch Thanks. You really do a great job in these videos.
Enabling „Requires fullscreen“, to fix the crash prevents using your app in multitasking though!
Are there alternative solutions other than “requires full screen”?
Extremely helpful video !
Thank you
Let me just start by saying your videos are amazing. The attention to detail is phenomenal. I learned so much. In regard to the TabView, if there's currently a way to hide TabSection headers in the TabBar view while keeping them visible in the Sidebar view, and more importantly, while still showing the tabs themselves in the TabBar. To be more clear I have a section and within those sections I have tabs. In sidebar view I can see the section and its Tabs, in the TabView I can only see the section or the first tab. Now is there a way to hide the section in the TabView and only shows its tabs?
You can hide a section from the Tab View, using .tabPlacement(.sidebarOnly)
However, you cannot show the individual tabs by default.
However, in the sidebar, when the user taps on one of the tabs in the section, it will appear on the tab bar after that.
What you could do is set the tabPlacement for each of the items in the section as .pinned, but this will pin them to the end of the tab bar and only show the icon.
Thank you for the video Stewart!! One question: how do you do a custom header at the top of each file? Do you do this manually or otherwise?
I cover this in this video: ua-cam.com/video/RACepNDGNyk/v-deo.html
@@StewartLynch thank you! 🤙🏾
Thank you very much! If I want to make TabSection closed by default, how can I achieve it?
I have not found a way to do that. You can remove the sidebar altogether by using .tabViewStyle(.tabBarOnly)
, but you do not get the option to bring it back
Bruh… transferable is incredible…
Yup, pretty amazing, isn't it
NOT WORKING:
TabView(selection: $currentTab) {
if #available(iOS 18.0, *) {
Tab("Installed fonts", systemImage: "signature") {
Text("Hello")
}
} else {
// Fallback on earlier versions
}
}
It says that "'buildExpression' is unavailable: this expression does not conform to 'View'"
You are mixing two different initializers so this won’t work. Bring the if #available outside the TabView. In iOS 18 the selection is set by a value not a tag.
@State private var currentTab = 0
var body: some View {
if #available(iOS 18.0, *) {
TabView(selection: $currentTab) {
Tab("Installed fonts", systemImage: "signature", value: 0) {
Text("Hello")
}
}
} else {
TabView(selection: $currentTab) {
Text("Hello")
.tabItem {
Label("Installed fonts", systemImage: "signature")
}
.tag(0)
}
}
}
thanks
Great video. I’ve learned a lot
Glad you enjoyed it!