pointfreeco/swift-navigation

Cannot pop correctly when operating a modal displayed UINavigationController

dazy1030 opened this issue · 0 comments

Description

After pushing a ViewController to a modal displayed UINavigationController with navigationDestination(item:content:), the modal is closed when it tries to pop by setting Item? to nil. My project uses UIKit to manage only the transitions and SwiftUI to implement the UI, using TCA. swift-navigation version 2.0.5 is used.

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

The modal is not closed, only the ViewController pops.

Actual behavior

The modal is closed without animation.

Steps to reproduce

  1. Modal display of UINavigationController with present(item:onDismiss:content:) .
  2. Push ViewController with navigationDestination(item:content:) .
  3. Set destination(: Item?) to nil and try to pop it.
  4. Modal is closed.

sample project: https://github.com/dazy1030/NavigationSample

Simulator.Screen.Recording.-.PRD.15.Pro.iOS.17.5.-.2024-08-17.at.13.10.09.mp4

SwiftUI Navigation version information

2.0.5

Destination operating system

iOS 17.5

Xcode version information

15.4 (15F31d)

Swift Compiler version information

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0