Xcode Previews

RSS for tag

Create an app UI and configure almost everything your users see using Xcode Previews.

Posts under Xcode Previews tag

201 Posts

Post

Replies

Boosts

Views

Activity

Firebase is not working on X-code 16 iOS 18 simulator
I have updated my firebase with the latest version, but on simulator, apple log in and parsing from firebase server is not working on iOS 18 when working fine on the actual test device. However iOS 17 simulator works perfect as X-Code 15. And previews are not working as well with my current app coding, which was coded in previous X-code 15. Is there any API changes? Any help? Or 18.1 might fix this bug?
1
0
1.5k
Sep ’24
Swift Macro for SwiftUI Previews Not Recognized in Xcode
Here's a concise post for the Apple Developer Forums: Title: Swift Macro for SwiftUI Previews Not Recognized in Xcode Hello everyone, I've developed a Swift macro swift-inject-preview that generates SwiftUI previews (PreviewProvider or #Preview). However, Xcode seems to ignore the previews generated by the macro, likely because it searches for PreviewProvider/#Preview or similar text in the file before macro expansion. Has anyone encountered a similar issue or found a workaround for getting Xcode to recognize previews created through Swift macros? Any help or insight would be greatly appreciated! Thank you! Daniil Voidilov
1
0
594
Sep ’24
Xcode do not pause at breakpoints
In the latest version of Xcode, breakpoints are not displaying correctly, making it difficult to track code behavior. Previously, Xcode allowed you to step through each function, showing clear execution steps and allowing interaction to debug effectively. However, now it only shows memory addresses without providing meaningful insights, limiting the ability to interact with or test the code as it's being developed. Is anyone else experiencing this issue, or does anyone know of a workaround?
1
1
919
Sep ’24
#Preview a Widget placeholder?
While I am able to use #Preview to preview a Widget, it seems to be not possible to easily preview a Widget placeholder. With a "classic" preview I can use .redacted(reason: .placeholder), but this has limitation e.g. it will ignore .contentMarginsDisabled() struct MyWidget_Previews: PreviewProvider { static var previews: some View { Group { MyWidgetView(entry: SimpleEntry(date: .now, emoji: "😀")) MyWidgetView(entry: SimpleEntry(date: .now, emoji: "😀")) .redacted(reason: .placeholder) } .previewContext(WidgetPreviewContext(family: .systemMedium)) .containerBackground(.white, for: .widget) } } If I use #Preview, the .redacted modifier won't work, and I seem to have to put it in the MyWidget implementation. #Preview(as: .systemMedium) { MyWidget() } timeline: { SimpleEntry(date: .now, emoji: "😀") SimpleEntry(date: .now, emoji: "🤩") } Am I missing something?
1
0
1k
Sep ’24
Xcode preview crash continuously
Hi. Just update my MacBook Pro M1 with sequoia and Xcode and I got huge problem with preview on simply swiftui pages. This is the full report I got when the preview crash but if I run the app on the device or the simulator it works fine. How can I solve this situation? the crashing thread is number 6 which reports this: Thread 6 Crashed:: Dispatch queue: com.apple.root.user-initiated-qos 0 XOJIT 0x240b899f8 llvm::Error llvm::detail::UniqueFunctionBase<llvm::Error, llvm::jitlink::LinkGraph&>::CallImpl<xojit::ReplacementManager::Plugin::modifyPassConfig(llvm::orc::MaterializationResponsibility&, llvm::jitlink::LinkGraph&, llvm::jitlink::PassConfiguration&)::'lambda'(llvm::jitlink::LinkGraph&)>(void*, llvm::jitlink::LinkGraph&) + 1784 1 XOJIT 0x240c1b46c llvm::jitlink::JITLinkerBase::runPasses(std::__1::vector<llvm::unique_function<llvm::Error (llvm::jitlink::LinkGraph&)>, std::__1::allocator<llvm::unique_function<llvm::Error (llvm::jitlink::LinkGraph&)>>>&) + 76 2 XOJIT 0x240c1ab68 llvm::jitlink::JITLinkerBase::linkPhase1(std::__1::unique_ptr<llvm::jitlink::JITLinkerBase, std::__1::default_delete<llvm::jitlink::JITLinkerBase>>) + 72 3 XOJIT 0x240c2158c llvm::jitlink::link_MachO_arm64(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 3608 4 XOJIT 0x240c20400 llvm::jitlink::link_MachO(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 72 5 XOJIT 0x240c19cc8 llvm::jitlink::link(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 80 6 XOJIT 0x240c0acc0 llvm::orc::ObjectLinkingLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_delete<llvm::orc::MaterializationResponsibility>>, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>) + 256 7 XOJIT 0x240bfcbfc llvm::orc::BasicObjectLayerMaterializationUnit::materialize(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_delete<llvm::orc::MaterializationResponsibility>>) + 60 8 XOJIT 0x240be3f08 llvm::orc::MaterializationTask::run() + 44 9 XOJIT 0x240b97e1c invocation function for block in (anonymous namespace)::GCDTaskDispatcher::dispatch(std::__1::unique_ptr<llvm::orc::Task, std::__1::default_delete<llvm::orc::Task>>) + 108 10 libdispatch.dylib 0x1801774ec _dispatch_call_block_and_release + 24 11 libdispatch.dylib 0x180178de0 _dispatch_client_callout + 16 12 libdispatch.dylib 0x18018b864 _dispatch_root_queue_drain + 1208 13 libdispatch.dylib 0x18018bf60 _dispatch_worker_thread2 + 232 14 libsystem_pthread.dylib 0x104db7b38 _pthread_wqthread + 224 15 libsystem_pthread.dylib 0x104db6934 start_wqthread + 8 Full Report
5
5
5.1k
Sep ’24
PreviewShell crashes and breaks the preview canvas
Since the first beta of Xcode 16, randomly when editing a SwiftUI view a crash report opens with the message "PreviewShell quit unexpectedly." After that, annoyingly often the canvas fails to reload correctly, and shows this broken thing: The only way to get it working again is to restart Xcode, but it happens so often that it really impacts productivity. Does this happen to anyone else? If so, have you found a solution? I've already filed a report (FB14876223)
9
8
4k
Sep ’24
Live Preview fails after adding 3rdParty libraries
With the latest Xcode 16 RC version, the Live Preview on iPhone device problem has been fixed. However, it still fails on the iPhone 16 pro preview emulator even for the simplest hello world view. Apparently in Xcode 16, introducing any 3rdParty package impacts the preview build, even if the package is not referenced in the view. I feel this is an incorrect behaviour. Following are the steps to reproduce the problem: Create a new iOS project in the latest Xcode 16 beta Select ContentView in the project and verify the live preview is working and fast Go the project’s Package Dependencies tab, add gRPC-Swift (https://github.com/grpc/grpc-swift.git) as a 3rdParty library of this project. Go the main project target, select General tab. Under Frameworks, Libraries, and Embedded Content section, add “GRPC” Go back to ContentView and verify its live preview rendering now takes very long time and eventually failed. Select Live Preview Diagnostic, verify error message: Failed to launch app ”PreviewBug.app” in reasonable time… I have also created a feedback to Apple: FB15110765
4
0
778
Sep ’24
Xcode 16 beta 6 LLVMError: LLVMError(description: "file too small to be an archive")
We are using TensorFlowLiteC XCFramework and encountering an issue. Download link: https://dl.google.com/tflite-release/ios/prod/tensorflow/lite/release/ios/release/30/20231002-210715/TensorFlowLiteC/2.14.0/883c6fc838e0354b/TensorFlowLiteC-2.14.0.tar.gz Whenever this framework is linked, Previews fail with the following error: == PREVIEW UPDATE ERROR: FailedToLaunchAppError: Failed to launch cg.Xcode16TensorPreviewsRepro ================================== | [Remote] JITError | | ================================== | | | [Remote] LLVMError | | | | LLVMError: LLVMError(description: "file too small to be an archive") Since Xcode 16 will soon be the IDE for all our devs, it would be great if the community or Xcode Previews team could share any workarounds or solutions for this issue. FB(reproducer + additional diagnostics): https://feedbackassistant.apple.com/feedback/15084788 Thanks
1
1
1.2k
Sep ’24
Can't view SwiftUI previews on Vision Pro because of code signing
Hello! I'm making an app for VisionOS. I can run the app on my Vision Pro, and I can see the SwiftUI previews in the simulator, but for some reason the previews refuse to run on the device. Here's what I'm seeing: == PREVIEW UPDATE ERROR: AppHostMustHaveGetTaskAllowError: Cards.app not code signed properly ”Cards.app” must be code signed in order to use on-device previews. Check your code signing settings for the target. As far as I can tell, the code signing settings are correct because the app itself runs just fine on the device. I'm not sure what to do…
1
0
769
Sep ’24
Xcode 16.0 beta 6: Preview: Permission denied
I'm having two users on my MBP and one user has an issue with Xcode Preview. - I thought this was a known issue and solve in an older beta version, but I still got the issue Xcode 16.0. beta 6 Cannot preview in this file XOJITError: Could not create code file directory for session: Permission denied multiple (admin) users, but one user has the issue, the other user not
2
1
888
Sep ’24
Xcode Previews broken after setting different bundle identifier for debug/release modes
I wanted to be able to install both an App Store/Release version and a development version of my app on the same device and have them access different persistent stores, so I changed the bundle identifier of my app for the debug build configuration to "com.kevinolmats.Guru.debug", while the release configuration stayed as "com.kevinolmats.Guru". Since then, Xcode previews have completely stopped working. After a long build time, the canvas displays Cannot show preview: check whether the preview is compiled for the current scheme and OS of the device used for previewing. The only things I have changed are: the bundle identifier for the debug configuration the product and bundle names (debug config is now Guru (debug)) added a new entitlements file for the debug configuration Any ideas as to why my previews have stopped working? Enable previews is set to on, and the usual troubleshooting steps (restarting Xcode, my computer, deleting DerivedData) have not helped. The app runs perfectly fine otherwise--it's just previews that are broken.
2
1
960
Aug ’24
AppStore Preview stuck in "Processing"
Im submitting a new App yesterday and included a video preview file for several size devices (6.7, and a copy of 6.7 for 6.5, 5.5 and 12.9). The iPhone files each took 5-10 minutes of processing (where the file icon shows a cloud image) but each eventually worked. All files uploaded fine, but now many hours later a preview file (video) is still processing - is still showing a cloud icon. All these uploaded preview files are about the same size at about 40M. The AppStore will not allow me to submit the App for review due to: Preview File Still Processing! What is my recourse?
0
0
644
Aug ’24
Vision Pro preview window looks different than on simulator
Hello, I have a simple SwiftUI view that shows this bottom bar in the view and I noticed that in SwiftUI previews the 2D window is squared off while in the simulator it has rounded edges. This effects the bottom bar because as you can see in the simulator the text is cut off. I am using Xcode 16 beta and visionOS 2 beta. Why do the two windows look different? And I am surprised the text is getting cut off in the rounded window. SwiftUI Preview: Vision Pro Simulator
6
0
1.3k
Jul ’24
XCode Previews
Hello... for some reason, XCode previews are no longer working for me. It was working fine a week ago, however, now no matter ho many times i reboot or restart my computer, the preview won't load. The preview is stuck on "loading Preview" no matter how long I wait. I ran the same files on swift playgrounds and the preview works fine there, but not on XCode. I ran both my project and a completely new, unedited project and both will not preview- so I know it is not a problem with my file. Also, the second I open the app the preview pauses. Either way, I don't think an app with only one file should take so long to build...
2
1
1k
Jul ’24
How to change the background color of the status bar in SwiftUI when creating a custom NavigationController View
I wanted to experiment a little using UINavigationController with SwiftUI App Lifecycle I created a Custom Navigation Controller named JDNavigationController. It does not do much other than having the @Observable macro public struct NavigationControllerStack<Content: View>: UIViewControllerRepresentable { private let initialView: () -> Content @State private var controller = JDNavigationController() public init(content: @escaping () -> Content) { self.initialView = content } public func makeUIViewController(context: Context) -> JDNavigationController { let viewController = self.initialView() .environment(self.controller) .viewController self.controller.viewControllers = [ viewController ] return controller } public func updateUIViewController(_ uiViewController: JDNavigationController, context: Context) { } public typealias UIViewControllerType = JDNavigationController } when I check, the functionality of the navigation controller works as expected, however, I can't for the life of me to change the background color of the status bar. #Preview { NavigationControllerStack { ZStack { Color.purple .ignoresSafeArea(.all) VStack { Text("somethign") } } } } I have tried Using the appearance functions Creating a Custom View Controller, and in that view controller I tried using a Hosting Controller by adding the hosting controller as a child and setting hostingController.view.insetsLayoutMarginsFromSafeArea = false using the toolbar modifiers from SwiftUI View none seems to work. I opened the View Debugger it looks like the white portion comes from the UIHosting Controller but I am not sure what I can do to fix it
6
0
2.0k
Jul ’24
SwiftUI preview with different @AppStorage values
I have SwiftUI views, which access the user defaults by using the property wrapper @AppStorage. Now I would like to have a preview with multiple variations of the view depending on the same user default with different values. Is there a pure way to do that? Currently I have a solution which is very probably a hack and supports only one variation of the user default. To do that I define the user settings in a sub views onAppear() method: struct MyTestedView_Previews : PreviewProvider { static var previews: some View { VStack { VStack { MyTestedView .previewLayout(.sizeThatFits) } .onAppear{ UserDefaults.standard.set(true, forKey: "myConsumedKey") } //VStack //{ // MyTestedView // .previewLayout(.sizeThatFits) //} //.onAppear{ // UserDefaults.standard.set(false, forKey: "myConsumedKey") //} } } } When I have two VStack for different variations and I set the user defaults to different values in their onAppear(), only one user default value wins and I see one variation of my view twice. What I also don't like on my solution, is that I don't know where this user default is stored. Is it stored temporary in the memory or do I even manipulate Xcode's user defaults? Does anybody know if SwiftUI has already a solution to test different variations of user defaults in the preview?
2
0
1.5k
Jul ’24
Firebase is not working on X-code 16 iOS 18 simulator
I have updated my firebase with the latest version, but on simulator, apple log in and parsing from firebase server is not working on iOS 18 when working fine on the actual test device. However iOS 17 simulator works perfect as X-Code 15. And previews are not working as well with my current app coding, which was coded in previous X-code 15. Is there any API changes? Any help? Or 18.1 might fix this bug?
Replies
1
Boosts
0
Views
1.5k
Activity
Sep ’24
Swift Macro for SwiftUI Previews Not Recognized in Xcode
Here's a concise post for the Apple Developer Forums: Title: Swift Macro for SwiftUI Previews Not Recognized in Xcode Hello everyone, I've developed a Swift macro swift-inject-preview that generates SwiftUI previews (PreviewProvider or #Preview). However, Xcode seems to ignore the previews generated by the macro, likely because it searches for PreviewProvider/#Preview or similar text in the file before macro expansion. Has anyone encountered a similar issue or found a workaround for getting Xcode to recognize previews created through Swift macros? Any help or insight would be greatly appreciated! Thank you! Daniil Voidilov
Replies
1
Boosts
0
Views
594
Activity
Sep ’24
Xcode do not pause at breakpoints
In the latest version of Xcode, breakpoints are not displaying correctly, making it difficult to track code behavior. Previously, Xcode allowed you to step through each function, showing clear execution steps and allowing interaction to debug effectively. However, now it only shows memory addresses without providing meaningful insights, limiting the ability to interact with or test the code as it's being developed. Is anyone else experiencing this issue, or does anyone know of a workaround?
Replies
1
Boosts
1
Views
919
Activity
Sep ’24
#Preview a Widget placeholder?
While I am able to use #Preview to preview a Widget, it seems to be not possible to easily preview a Widget placeholder. With a "classic" preview I can use .redacted(reason: .placeholder), but this has limitation e.g. it will ignore .contentMarginsDisabled() struct MyWidget_Previews: PreviewProvider { static var previews: some View { Group { MyWidgetView(entry: SimpleEntry(date: .now, emoji: "😀")) MyWidgetView(entry: SimpleEntry(date: .now, emoji: "😀")) .redacted(reason: .placeholder) } .previewContext(WidgetPreviewContext(family: .systemMedium)) .containerBackground(.white, for: .widget) } } If I use #Preview, the .redacted modifier won't work, and I seem to have to put it in the MyWidget implementation. #Preview(as: .systemMedium) { MyWidget() } timeline: { SimpleEntry(date: .now, emoji: "😀") SimpleEntry(date: .now, emoji: "🤩") } Am I missing something?
Replies
1
Boosts
0
Views
1k
Activity
Sep ’24
Xcode preview crash continuously
Hi. Just update my MacBook Pro M1 with sequoia and Xcode and I got huge problem with preview on simply swiftui pages. This is the full report I got when the preview crash but if I run the app on the device or the simulator it works fine. How can I solve this situation? the crashing thread is number 6 which reports this: Thread 6 Crashed:: Dispatch queue: com.apple.root.user-initiated-qos 0 XOJIT 0x240b899f8 llvm::Error llvm::detail::UniqueFunctionBase<llvm::Error, llvm::jitlink::LinkGraph&>::CallImpl<xojit::ReplacementManager::Plugin::modifyPassConfig(llvm::orc::MaterializationResponsibility&, llvm::jitlink::LinkGraph&, llvm::jitlink::PassConfiguration&)::'lambda'(llvm::jitlink::LinkGraph&)>(void*, llvm::jitlink::LinkGraph&) + 1784 1 XOJIT 0x240c1b46c llvm::jitlink::JITLinkerBase::runPasses(std::__1::vector<llvm::unique_function<llvm::Error (llvm::jitlink::LinkGraph&)>, std::__1::allocator<llvm::unique_function<llvm::Error (llvm::jitlink::LinkGraph&)>>>&) + 76 2 XOJIT 0x240c1ab68 llvm::jitlink::JITLinkerBase::linkPhase1(std::__1::unique_ptr<llvm::jitlink::JITLinkerBase, std::__1::default_delete<llvm::jitlink::JITLinkerBase>>) + 72 3 XOJIT 0x240c2158c llvm::jitlink::link_MachO_arm64(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 3608 4 XOJIT 0x240c20400 llvm::jitlink::link_MachO(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 72 5 XOJIT 0x240c19cc8 llvm::jitlink::link(std::__1::unique_ptr<llvm::jitlink::LinkGraph, std::__1::default_delete<llvm::jitlink::LinkGraph>>, std::__1::unique_ptr<llvm::jitlink::JITLinkContext, std::__1::default_delete<llvm::jitlink::JITLinkContext>>) + 80 6 XOJIT 0x240c0acc0 llvm::orc::ObjectLinkingLayer::emit(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_delete<llvm::orc::MaterializationResponsibility>>, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>) + 256 7 XOJIT 0x240bfcbfc llvm::orc::BasicObjectLayerMaterializationUnit::materialize(std::__1::unique_ptr<llvm::orc::MaterializationResponsibility, std::__1::default_delete<llvm::orc::MaterializationResponsibility>>) + 60 8 XOJIT 0x240be3f08 llvm::orc::MaterializationTask::run() + 44 9 XOJIT 0x240b97e1c invocation function for block in (anonymous namespace)::GCDTaskDispatcher::dispatch(std::__1::unique_ptr<llvm::orc::Task, std::__1::default_delete<llvm::orc::Task>>) + 108 10 libdispatch.dylib 0x1801774ec _dispatch_call_block_and_release + 24 11 libdispatch.dylib 0x180178de0 _dispatch_client_callout + 16 12 libdispatch.dylib 0x18018b864 _dispatch_root_queue_drain + 1208 13 libdispatch.dylib 0x18018bf60 _dispatch_worker_thread2 + 232 14 libsystem_pthread.dylib 0x104db7b38 _pthread_wqthread + 224 15 libsystem_pthread.dylib 0x104db6934 start_wqthread + 8 Full Report
Replies
5
Boosts
5
Views
5.1k
Activity
Sep ’24
PreviewShell crashes and breaks the preview canvas
Since the first beta of Xcode 16, randomly when editing a SwiftUI view a crash report opens with the message "PreviewShell quit unexpectedly." After that, annoyingly often the canvas fails to reload correctly, and shows this broken thing: The only way to get it working again is to restart Xcode, but it happens so often that it really impacts productivity. Does this happen to anyone else? If so, have you found a solution? I've already filed a report (FB14876223)
Replies
9
Boosts
8
Views
4k
Activity
Sep ’24
Why was Editor -> Canvas subsection removed from XCode 16.1 beta?
In XCode 16, there's the Canvas section within Editor. This is XCode 16.1 beta. "Canvas" subitem appears in Search but does not appear under Editor section Previews do not work for me without using Legacy Previews Extension, so I can no longer use Previews at all with XCode 16.1 Beta. Why was Canvas subsection under Editor removed?c
Replies
1
Boosts
0
Views
757
Activity
Sep ’24
Xcode 16 preview not working
I want to add SwiftUI to an existing package. Super simple to get started. It previews with Xcode 15.4, but gives an error on Xcode 16.0: JITError: Runtime linking failure Anyone have an idea on what may be failing? Full SwiftUI code: import SwiftUI struct Dashboard: View { var body: some View { Text("hello") } } #Preview { Dashboard() }
Replies
4
Boosts
3
Views
4.4k
Activity
Sep ’24
Live Activity Preview Not Working - Failed to launch app in reasonable time
AppLaunchTimeoutError: Failed to launch app ”x.app” in reasonable time The app ”x.app” did not launch on ”iPhone 15 Pro” in 15 seconds. it always show that error, when it show i have to apply this command on terminal xcrun simctl --set previews delete all but after 30 seconds, i am facing with same issue.
Replies
1
Boosts
1
Views
896
Activity
Sep ’24
Live Preview fails after adding 3rdParty libraries
With the latest Xcode 16 RC version, the Live Preview on iPhone device problem has been fixed. However, it still fails on the iPhone 16 pro preview emulator even for the simplest hello world view. Apparently in Xcode 16, introducing any 3rdParty package impacts the preview build, even if the package is not referenced in the view. I feel this is an incorrect behaviour. Following are the steps to reproduce the problem: Create a new iOS project in the latest Xcode 16 beta Select ContentView in the project and verify the live preview is working and fast Go the project’s Package Dependencies tab, add gRPC-Swift (https://github.com/grpc/grpc-swift.git) as a 3rdParty library of this project. Go the main project target, select General tab. Under Frameworks, Libraries, and Embedded Content section, add “GRPC” Go back to ContentView and verify its live preview rendering now takes very long time and eventually failed. Select Live Preview Diagnostic, verify error message: Failed to launch app ”PreviewBug.app” in reasonable time… I have also created a feedback to Apple: FB15110765
Replies
4
Boosts
0
Views
778
Activity
Sep ’24
Xcode 16 beta 6 LLVMError: LLVMError(description: "file too small to be an archive")
We are using TensorFlowLiteC XCFramework and encountering an issue. Download link: https://dl.google.com/tflite-release/ios/prod/tensorflow/lite/release/ios/release/30/20231002-210715/TensorFlowLiteC/2.14.0/883c6fc838e0354b/TensorFlowLiteC-2.14.0.tar.gz Whenever this framework is linked, Previews fail with the following error: == PREVIEW UPDATE ERROR: FailedToLaunchAppError: Failed to launch cg.Xcode16TensorPreviewsRepro ================================== | [Remote] JITError | | ================================== | | | [Remote] LLVMError | | | | LLVMError: LLVMError(description: "file too small to be an archive") Since Xcode 16 will soon be the IDE for all our devs, it would be great if the community or Xcode Previews team could share any workarounds or solutions for this issue. FB(reproducer + additional diagnostics): https://feedbackassistant.apple.com/feedback/15084788 Thanks
Replies
1
Boosts
1
Views
1.2k
Activity
Sep ’24
Can't view SwiftUI previews on Vision Pro because of code signing
Hello! I'm making an app for VisionOS. I can run the app on my Vision Pro, and I can see the SwiftUI previews in the simulator, but for some reason the previews refuse to run on the device. Here's what I'm seeing: == PREVIEW UPDATE ERROR: AppHostMustHaveGetTaskAllowError: Cards.app not code signed properly ”Cards.app” must be code signed in order to use on-device previews. Check your code signing settings for the target. As far as I can tell, the code signing settings are correct because the app itself runs just fine on the device. I'm not sure what to do…
Replies
1
Boosts
0
Views
769
Activity
Sep ’24
Xcode 16.0 beta 6: Preview: Permission denied
I'm having two users on my MBP and one user has an issue with Xcode Preview. - I thought this was a known issue and solve in an older beta version, but I still got the issue Xcode 16.0. beta 6 Cannot preview in this file XOJITError: Could not create code file directory for session: Permission denied multiple (admin) users, but one user has the issue, the other user not
Replies
2
Boosts
1
Views
888
Activity
Sep ’24
Xcode Previews broken after setting different bundle identifier for debug/release modes
I wanted to be able to install both an App Store/Release version and a development version of my app on the same device and have them access different persistent stores, so I changed the bundle identifier of my app for the debug build configuration to "com.kevinolmats.Guru.debug", while the release configuration stayed as "com.kevinolmats.Guru". Since then, Xcode previews have completely stopped working. After a long build time, the canvas displays Cannot show preview: check whether the preview is compiled for the current scheme and OS of the device used for previewing. The only things I have changed are: the bundle identifier for the debug configuration the product and bundle names (debug config is now Guru (debug)) added a new entitlements file for the debug configuration Any ideas as to why my previews have stopped working? Enable previews is set to on, and the usual troubleshooting steps (restarting Xcode, my computer, deleting DerivedData) have not helped. The app runs perfectly fine otherwise--it's just previews that are broken.
Replies
2
Boosts
1
Views
960
Activity
Aug ’24
AppStore Preview stuck in "Processing"
Im submitting a new App yesterday and included a video preview file for several size devices (6.7, and a copy of 6.7 for 6.5, 5.5 and 12.9). The iPhone files each took 5-10 minutes of processing (where the file icon shows a cloud image) but each eventually worked. All files uploaded fine, but now many hours later a preview file (video) is still processing - is still showing a cloud icon. All these uploaded preview files are about the same size at about 40M. The AppStore will not allow me to submit the App for review due to: Preview File Still Processing! What is my recourse?
Replies
0
Boosts
0
Views
644
Activity
Aug ’24
Vision Pro preview window looks different than on simulator
Hello, I have a simple SwiftUI view that shows this bottom bar in the view and I noticed that in SwiftUI previews the 2D window is squared off while in the simulator it has rounded edges. This effects the bottom bar because as you can see in the simulator the text is cut off. I am using Xcode 16 beta and visionOS 2 beta. Why do the two windows look different? And I am surprised the text is getting cut off in the rounded window. SwiftUI Preview: Vision Pro Simulator
Replies
6
Boosts
0
Views
1.3k
Activity
Jul ’24
XCode Previews
Hello... for some reason, XCode previews are no longer working for me. It was working fine a week ago, however, now no matter ho many times i reboot or restart my computer, the preview won't load. The preview is stuck on "loading Preview" no matter how long I wait. I ran the same files on swift playgrounds and the preview works fine there, but not on XCode. I ran both my project and a completely new, unedited project and both will not preview- so I know it is not a problem with my file. Also, the second I open the app the preview pauses. Either way, I don't think an app with only one file should take so long to build...
Replies
2
Boosts
1
Views
1k
Activity
Jul ’24
How to change the background color of the status bar in SwiftUI when creating a custom NavigationController View
I wanted to experiment a little using UINavigationController with SwiftUI App Lifecycle I created a Custom Navigation Controller named JDNavigationController. It does not do much other than having the @Observable macro public struct NavigationControllerStack<Content: View>: UIViewControllerRepresentable { private let initialView: () -> Content @State private var controller = JDNavigationController() public init(content: @escaping () -> Content) { self.initialView = content } public func makeUIViewController(context: Context) -> JDNavigationController { let viewController = self.initialView() .environment(self.controller) .viewController self.controller.viewControllers = [ viewController ] return controller } public func updateUIViewController(_ uiViewController: JDNavigationController, context: Context) { } public typealias UIViewControllerType = JDNavigationController } when I check, the functionality of the navigation controller works as expected, however, I can't for the life of me to change the background color of the status bar. #Preview { NavigationControllerStack { ZStack { Color.purple .ignoresSafeArea(.all) VStack { Text("somethign") } } } } I have tried Using the appearance functions Creating a Custom View Controller, and in that view controller I tried using a Hosting Controller by adding the hosting controller as a child and setting hostingController.view.insetsLayoutMarginsFromSafeArea = false using the toolbar modifiers from SwiftUI View none seems to work. I opened the View Debugger it looks like the white portion comes from the UIHosting Controller but I am not sure what I can do to fix it
Replies
6
Boosts
0
Views
2.0k
Activity
Jul ’24
SwiftUI preview with different @AppStorage values
I have SwiftUI views, which access the user defaults by using the property wrapper @AppStorage. Now I would like to have a preview with multiple variations of the view depending on the same user default with different values. Is there a pure way to do that? Currently I have a solution which is very probably a hack and supports only one variation of the user default. To do that I define the user settings in a sub views onAppear() method: struct MyTestedView_Previews : PreviewProvider { static var previews: some View { VStack { VStack { MyTestedView .previewLayout(.sizeThatFits) } .onAppear{ UserDefaults.standard.set(true, forKey: "myConsumedKey") } //VStack //{ // MyTestedView // .previewLayout(.sizeThatFits) //} //.onAppear{ // UserDefaults.standard.set(false, forKey: "myConsumedKey") //} } } } When I have two VStack for different variations and I set the user defaults to different values in their onAppear(), only one user default value wins and I see one variation of my view twice. What I also don't like on my solution, is that I don't know where this user default is stored. Is it stored temporary in the memory or do I even manipulate Xcode's user defaults? Does anybody know if SwiftUI has already a solution to test different variations of user defaults in the preview?
Replies
2
Boosts
0
Views
1.5k
Activity
Jul ’24