Skip to content

How to user childStack with TabView on SwiftUI #212

Answered by azlekov
azlekov asked this question in Q&A
Discussion options

You must be logged in to vote

Following the examples and some testing I was able to use the default TabView:

struct BottomNavView: View {
    private let component: BottomNav
    @State private var selection: BottomNavItem = .homes
    
    private let bottomNavItems = [
        TabItem(item: .homes, title: "Homes", image: "home-icon"),
        TabItem(item: .access, title: "Access", image: "access-icon"),
        TabItem(item: .calendar, title: "Calendar", image: "calendar-icon"),
        TabItem(item: .profile, title: "Profile", image: "profile-icon"),
    ]
    
    @ObservedObject
    private var childStack: ObservableValue<ChildStack<AnyObject, BottomNavChild>>
    private var activeChild: BottomNavChild { childS…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@azlekov
Comment options

Comment options

You must be logged in to vote
9 replies
@arkivanov
Comment options

@b95505017
Comment options

@azlekov
Comment options

@b95505017
Comment options

@b95505017
Comment options

Answer selected by azlekov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants