2

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, sourceType: sourceType)
}

and when the user chooses or takes an image, on dismiss I want to show some spinner until image will be classified, and later to navigate and send this image to another view.

How can I navigate to another view from loadImageAndNavigate func?

pawello2222
  • 46,897
  • 22
  • 145
  • 209
Jkrist
  • 748
  • 1
  • 6
  • 24
  • Create some variable responsible for showing your other view and set it to `true` in `loadImageAndNavigate`. Then activate a `NavigationLink` programatically like in https://stackoverflow.com/a/63367285/8697793 – pawello2222 Dec 29 '20 at 23:14

0 Answers0