Questions tagged [swiftui-navigationview]

For questions about NavigationView - a view in Apple's SwiftUI framework that presents a stack of views representing a visible path in a navigation hierarchy. When using this tag also include the more generic [swiftui] tag where possible.

Links:

583 questions
2
votes
2 answers

How to navigate back to UIViewController from SwiftUI View?

I'm using SwiftUI 1.0 in all my views starting from MainView which is the Home screen other than the Login as I'm using a client LoginSDK which is made via UIKit. So in LoginViewController, I'm able to push the MainView() on sucessful login with…
2
votes
1 answer

In SwiftUI how can I bold the primaryAction ToolbarItem?

How can I get the ToolbarItem to bold the primaryAction? I have been able to change the color by setting the accent color on the NavigationView. Primarily looking for a SwiftUI solution but I will settle for UI Kit solution if not possible. My…
Andrew Stoddart
  • 408
  • 4
  • 9
2
votes
2 answers

SwiftUI: Launching three column iPad app with the Sidebar Visible

Using the below code it’s possible to create a basic three-column iPad layout. @main struct threepanelApp: App { var body: some Scene { WindowGroup { NavigationView { List(0..<10, rowContent: { i in …
Stuart Breckenridge
  • 1,873
  • 1
  • 16
  • 18
2
votes
3 answers

List scroll freeze on catalyst NavigationView

I've run in to an odd problem with NavigationView on macCatalyst. Here below is a simple app with a sidebar and a detail view. Selecting an item on the sidebar shows a detail view with a scrollable list. Everything works fine for the first…
2
votes
1 answer

ForEach in List stops update propagation in DestinationView

I think is very clear from this dummy example: if you remove the ForEach code row, magically, the propagation will flow and clock will tick, otherwise it will freeze once the detail view is presented. class ModelView: ObservableObject { …
2
votes
1 answer

swiftUI - can't close modal screen after force screen to Landscape

I open a full modal view .fullScreenCover(isPresented: self.$isPresentedPlayerView){ NavigationLazyView((MainPlayerView(playerVM: PlayerVM(asset: self.mediaVM.asset), showModal: self.$isPresentedPlayerView))) } and in playerView .onApper i…
israel_b_2012
  • 277
  • 1
  • 2
  • 8
2
votes
1 answer

SwiftUI broken animation on simulator

I have been playing around with SwiftUI and its animation. Below is my code of a circle inside a navigationView with scaleEffect animation @State private var isAnimating = false NavigationView{ VStack{ ZStack{ Circle() …
dw96
  • 35
  • 2
  • 6
2
votes
0 answers

CNContactView controller's cancel button disappears while typing and then reappears

I'm working with SwiftUI, I'm using a NavigationView, then a NavigationLink which takes to a UIViewControllerRepresentable of a CNContactViewController. UIViewControllerRepresentable: import SwiftUI import ContactsUI struct ContactView:…
2
votes
1 answer

Placing TabView inside NavigationView makes header transparent

TabView worked fine for me before i added NavigationView around it. Here's a normal behaviour A problem arises when i add NavigationView around my TabView - when scrolling I see "test" in front of black rectangle. I tried…
eugene_prg
  • 948
  • 2
  • 12
  • 25
2
votes
0 answers

SwiftUI NavigationView Push view without another view

Given is View1, View2 & View3. I pushed View2 over View1. Is there's a way to push View3 from View1 maintaining navigation stack? struct ContentView: View { @State var selection: String? = nil var body: some View { NavigationView { …
Ayman Ibrahim
  • 1,359
  • 15
  • 24
2
votes
0 answers

How to navigate after few seconds in SwiftUI?

Need some extra help with SwiftUI and navigating between views. In one view, I have a button with ImagePicker: .sheet(isPresented: $showingImagePicker, onDismiss: loadImageAndNavigate) { ImagePicker(image: $image, isShown: $showingImagePicker,…
Jkrist
  • 748
  • 1
  • 6
  • 24
2
votes
3 answers

How to adjust navigationBarTitle and Label Text alignment in SwiftUI

I just learned swiftUI and I got little trouble. I want to make navigationBarTitle and title headline alignment like this: Image 1: I want to make my view like this I have tried to make like below but it does not work: struct HeaderView: View { var…
syaifulhusein
  • 121
  • 1
  • 14
2
votes
0 answers

Create a NavigationView stack and move from first view into last view in SwiftUI

I have a NavigationView in SwiftUI and a couple of views, let's assume that we have [View a, View b, View c, View d]. What I want is to move from "View a" into the "View d" without showing "View b", "View c" and being able to navigate back from…
2
votes
1 answer

SwiftUI NavigationLink behaviour is different when selection is set directly, rather than from viewModel

I've been working with SwiftUI and ran into unexpected behavior. I have View A and View B and View C. View C has EnviromentObject that changes AppState from View A View B has ViewModel with selection If I call function from ViewModel to change the…
2
votes
0 answers

SwiftUI NavigationLink isActive not working with dynamic Lists

Using a data-structure for isActive bools for dynamic NavigationLinks to enable a programmatic pop-back doesn't work. Tapping the Pop Back in the Destination should pop the view back to the root DynamicList, but it doesn't work. import…