Skip to content

Commit

Permalink
Fix iOS 17 crash related to SplitViewController (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
moglistree authored Jan 29, 2024
1 parent ebd1e68 commit 0ef9f76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.16.0
- Fix split view crash for iOS 17

# 1.15.3
- Support Xcode 15

Expand Down
5 changes: 5 additions & 0 deletions Presentation/UINavigationController+Presenting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ private extension UINavigationController {
extension UINavigationController {
func transferViewControllers(from: UINavigationController) {
viewControllers += from.viewControllers
/*
This line helps us prevent a crash that appeared with iOS 17. Explanation of the crash can
be found here https://stackoverflow.com/questions/77228311/nsinternalinconsistencyexception-reason-layout-requested-for-visible-naviga
*/
from.viewControllers = []
for pushPoper in from.popSignalPushPopers.compactMap({ $0.value }) {
let onComplete = pushPoper._onComplete
pushPoper.bag.dispose()
Expand Down

0 comments on commit 0ef9f76

Please sign in to comment.