Closed okwasniewski closed 5 months ago
cc @thiagobrez, would you be able to test it in your app?
@thymikee I'm using a custom setup on my app with native TabViews
, so I need to add the DevMenu myself, but it is not exported.
Already synced with @okwasniewski and he is aware, he will release a fix soon
var body: some Scene {
WindowGroup {
TabView {
RCTRootViewRepresentable(moduleName: "visionary")
.tabItem {
Label("Home", systemImage: "house.fill")
}
RCTRootViewRepresentable(moduleName: "SettingsScreen")
.tabItem {
Label("Settings", systemImage: "gear")
}
}
// Works great
.ornament(attachmentAnchor: .scene(.bottom)) {
VStack {
Button("Hey!") {}
}
.glassBackgroundEffect()
}
// Error: Cannot find 'DevMenuView' in scope
.toolbar {
DevMenuView(placement: .bottomOrnament)
}
}
}
After checking @thiagobrez custom solution I took a different approach. Now the dev menu is attached to RCTRootViewRepresentable
so even with something totally custom you will still get the dev menu ornament:
There is no need to add it manually now.
var body: some Scene {
WindowGroup {
TabView {
// Move dev menu ornament to the top
RCTRootViewRepresentable(moduleName: "visionary", devMenuSceneAnchor: .top)
.tabItem {
Label("Home", systemImage: "house.fill")
}
// Remove dev menu ornament from second window
RCTRootViewRepresentable(moduleName: "SettingsScreen", devMenuSceneAnchor: nil)
.tabItem {
Label("Settings", systemImage: "gear")
}
}
.ornament(attachmentAnchor: .scene(.bottom)) {
VStack {
Button("Hey!") {}
}
.glassBackgroundEffect()
}
}
}
Summary:
This PR allows users to move dev menu to avoid conflicts with their custom ornaments.
Changelog:
[VISIONOS] [ADDED] - allow to manually move dev menu to avoid conflicts
Test Plan:
Test if dev menu ornament can be moved