Xcode 14.0.1
Swift 5.7
iOS 16
SwiftUI
Originally, I hide ALL navigation bars in SwiftUI by below codes.
extension UINavigationController: ObservableObject, UIGestureRecognizerDelegate {
override open func viewDidLoad() {
navigationBar.isHidden = true
super.viewDidLoad()
}
// ... and also navigationBar.isHidden = true in viewWillAppear, viewWillDisappear
}
But after I update my Xcode, Swift and iOS version, it doesn't work. Navigation bars starts to show on views.
Is there any changes about UINavigationController in this version? How to fix this?
Thank you.
Post
Replies
Boosts
Views
Activity
Hi, our team is struggling in unintentional UI error of SwiftUI.
There has never been a problem like this before. However, it occurred after the iOS 15 update.
There is awkward gray box shape is floating on only SwiftUI Button, and NavigationLinks. You can see that in this image. This is a real image of Run of our app.
'a' is Empty NavigationLink like below code.
NavigationLink(destination: EmptyView()) {
EmptyView()
}
As you can check in code, there should not be floating gray box. Since both the destination and label are EmptyView, they must not be visible. However it is exposed to users, perhaps because of an error.
'b' is pure Image().
'c' is Button containing Image.
Button(action: action) {
Image("icon_bubble")
}.frame(width: 48, height: 48)
These code seems that never makes this gray box but it generates on Button and NavigationLink in SwiftUI.
This problem not occurs in every devices, but some iOS 15 devices have this problem. Although users install same app by same route, this box is reveal to specific user.
There is no box in my iPhone 13 and 13 mini but it is represented in my teammate's iPhone X and 13 mini.
We see the View Debugger by Reveal.
This Box is SwiftUI.UIShapeHitTestingView in SwiftUI.UIInheritedView. In this app, we don't set any hit testing options in project. But HitTestingView is presented to some specific devices.
Is there anyone how to solve this problem? How to process the UIShapeHitTestingView is hidden?
I wonder why some device display the box and other not even though they are on same condition(iOS version, Device, App Version).