Skip to content

Commit

Permalink
RUMM-1615 Workaround FB8907671 in 14.2 <= iOS < 14.5
Browse files Browse the repository at this point in the history
  • Loading branch information
maxep committed Oct 28, 2021
1 parent fb2a3e0 commit 337e379
Showing 1 changed file with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,51 @@ class SwiftUIRootViewController: UIHostingController<RootView> {
struct RootView: View {
var body: some View {
TabView {
tabNavigationView
.tabItem {
Text("Navigation View")
}

tabScreenView
.tabItem {
Text("Screen 100")
}
}
}

@ViewBuilder
var tabNavigationView: some View {
if #available(iOS 14.5, *) {
NavigationView {
ScreenView(index: 1)
}.tabItem {
Text("Navigation View")
}
} else if #available(iOS 14.2, *) {
NavigationView {
LazyVStack {
ScreenView(index: 1)
}
}
} else {
NavigationView {
ScreenView(index: 1)
}
}
}

@ViewBuilder
var tabScreenView: some View {
if #available(iOS 14.5, *) {
ScreenView(index: 100)
.tabItem {
Text("Screen 100")
} else if #available(iOS 14.2, *) {
LazyVStack {
ScreenView(index: 100)
}
} else {
ScreenView(index: 100)
}
}
}


@available(iOS 13, *)
/// A basic Screen View at a given index in the stack.
///
Expand Down

0 comments on commit 337e379

Please sign in to comment.