Context: I maintain an app that has a UITabBarController
at its root, and the tabs are UIHostingController
s to (mostly) SwiftUI views. I have a UINavigationController
I present from that tab bar controller, and the rootViewController of that presented nav is a UIHostingController
with SwiftUI views inside (not using NavigationView
in there, but I am using .toolbar
and NavigationLink
).
I'm trying to use TipKit in this presented SwiftUI view, and its led to a couple unexpected issues:
-
When I dismiss a tip, the entire presented view controller hierarchy is dismissed (like calling
window.rootViewController.dismiss()
)- somehow, configuring the tooltip inside of a
ButtonStyle
resolves this issue
- somehow, configuring the tooltip inside of a
-
When I show a tip pointing at a
Button
inside of the.toolbar
-
sometimes that tip is presented in the top left corner of the window, not pointing to the view properly
-
when the tip is dismissed, that button then stops calling its action and does nothing
-
Has anyone else experienced this/anything like it? Because of this (and other issues from the past) I get the sense that Apple is of the mind that you should either have a fully UIKit application, or a fully SwiftUI application, since issues with bridging between the two are not uncommon and solutions are unclear/undocumented. Curious what others think about this, and about maintaining UIKit/SwiftUI hybrid apps in general.