TreatTrick / Hide-TabBar-In-SwiftUI

This tutorial provides a solution to hide TabBars when using TabView in SwiftUI
185 stars 14 forks source link

Get Error Information When Run the Demo #1

Open Yang-Xijie opened 3 years ago

Yang-Xijie commented 3 years ago

I just cloned this repo and open it using Xcode 12.4, ran it on a simulator iPhone 12 with iOS 14.4. However, once build secceeded, I got the error info below:

2021-03-21 11:39:59.111302+0800 HideTabBarInNavigationView[18305:556332] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x60000016c3c0 'BIB_Trailing_CB_Leading' H:[_UIModernBarButton:0x7fad35f28ba0]-(6)-[_UIModernBarButton:0x7fad35f26940'Tab1']   (active)>",
    "<NSLayoutConstraint:0x60000016c410 'CB_Trailing_Trailing' _UIModernBarButton:0x7fad35f26940'Tab1'.trailing <= BackButton.trailing   (active, names: BackButton:0x7fad35f251f0 )>",
    "<NSLayoutConstraint:0x600000168730 'UINav_static_button_horiz_position' _UIModernBarButton:0x7fad35f28ba0.leading == UILayoutGuide:0x600001b01960'UIViewLayoutMarginsGuide'.leading   (active)>",
    "<NSLayoutConstraint:0x600000168780 'UINavItemContentGuide-leading' H:[BackButton]-(0)-[UILayoutGuide:0x600001b50700'UINavigationBarItemContentLayoutGuide']   (active, names: BackButton:0x7fad35f251f0 )>",
    "<NSLayoutConstraint:0x600000141d10 'UINavItemContentGuide-trailing' UILayoutGuide:0x600001b50700'UINavigationBarItemContentLayoutGuide'.trailing == _UINavigationBarContentView:0x7fad35d13530.trailing   (active)>",
    "<NSLayoutConstraint:0x600000168f00 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7fad35d13530.width == 0   (active)>",
    "<NSLayoutConstraint:0x600000165ef0 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x600001b01960'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UINavigationBarContentView:0x7fad35d13530 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000016c3c0 'BIB_Trailing_CB_Leading' H:[_UIModernBarButton:0x7fad35f28ba0]-(6)-[_UIModernBarButton:0x7fad35f26940'Tab1']   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

When I tap Here is Tab1 Tap me to NavigatedView things goes well. However, when return to ContentView (by clickinig <Tab1 on left upper corner), I got another error info printed in the console:

Trying to pop to a missing destination at /Library/Caches/com.apple.xbs/Sources/Monoceros_Sim/Monoceros-120/Shared/NavigationBridge_PhoneTV.swift:341

English is not my native language; please excuse typing errors. Any advice will be helpful!

Yang-Xijie commented 3 years ago

This issue has been reported on Stack Overflow and it seems not a big deal.

SwiftUI NavigationView trying to pop to missing destination