I found it helpful to use this on the RealityView.
Post
Replies
Boosts
Views
Activity
I am wondering about this as well.
Here is the reproducer.
Create a basic visionOS app in Xcode.
Place the ContentView in a NavigationView in the app file.
Paste the code below in the ContentView
When you run the app, press the "EmptyView" button. Click anywhere on the sidebar to see the warning appear in the console.
The ContentView code:
struct ContentView: View {
var body: some View {
List {
NavigationLink("EmptyView") { EmptyView() }
.isDetailLink(false)
}
.navigationTitle("Views")
.navigationBarTitleDisplayMode(.large)
}
}
Continuing my previous post here, we submitted a feedback ticket for this: FB15732009.
The crash that was posted in the original post that started this thread is slightly different than the crash I am seeing. This is the crash from the original post:
Library not loaded: /System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI
The crash I am seeing looks like this:
Library not loaded: /System/iOSSupport/System/Library/Frameworks/_QuickLook_SwiftUI.framework/Versions/A/_QuickLook_SwiftUI
The app that is crashing is using a dependency that we own and that dependency is using the quick look preview feature in SwiftUI. Which is probably why the quick look SwiftUI framework is being referenced in the crash log.
I archived our app using Xcode 16.1 and macOS 15.1, and it still crashes when it is run on macOS Ventura.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: Namespace DYLD, Code 1 Library missing
Library not loaded: /System/iOSSupport/System/Library/Frameworks/_QuickLook_SwiftUI.framework/Versions/A/_QuickLook_SwiftUI
Thank you! Here is the crash log.
crash_log.txt
That is good to know. I actually wanted the body of the if to be executed for visionOS but didn't understand why it was working. Thank you.
Can you explain why this situation crashes?
Also, I had this similar code that was distriubted via a xcframework and when that view is used in an app that is using the xcframework while running against visionOS there would be a runtime crash (EXC_BAD_ACCESS). The crash could only be reproduced when using that view from the xcframework and not the local source code. The problem was fixed by adding visionOS 1.0 to that availability check. But this shouldn't have been a crash in the first place.
Updated the original post: If you replace the MetalView() simply with EmptyView() it still shows a memory leak.
I just ran a visionOS 1.2 simulator that uses a MTKView with Xcode 16 beta 4 and it no longer crashes.
I'll give the ornament a shot. I didn't even consider that in the beginning because it seems like they are more meant for interactions with the view while this bar is simply meant to display copyright information about the data that is being presented. While the bar can be interacted with, that isn't its main goal. But hey I can give it a shot and let you know if I have more questions.
Thank you for your help.
It does work and doesn't look too bad. But if we wanted to add some custom padding to make it look exactly how we wish it wouldn't be possible because we don't know how a user would use our views and that could change how this bottom bar looks. We work on a native Swift SDK to add some context. So the user could use our view in a 2D window, 3D window, in a 2D window but as a subview, etc. And we don't have a way of knowing how to adjust our padding because there is no concept of safe area.
I'm not sure if this is deliberate or not but if you have any context on that it would be great.
Thank you again for the quick responses :)
Here is what the bottom bar looks like in different contexts:
2D Window:
3D Window:
2D window but with another view
Thank you Sydney. That makes sense.
Since the text is getting cut off in the simulator and there is no safe area insets for a window, is there a way to calculate the correct padding so the text isn't cut off? Rather than just using some hard-coded values for the padding.
Nope. I just installed visionOS 2 beta on the device and I'm using Xcode 16 beta. And I no longer see that issue with that combo.
Thank you for confirming! I look forward to hearing back from either here or the feedback report.
Thanks for the response!
We aren't using any of those methods hence why I was confused.