Search results for

show when run

112,674 results found

Post

Replies

Boosts

Views

Activity

Reply to init(), .onAppear and .onChange(of: scenePhase) Not Working when Opening App After Being Quitted
Below is compilable code: struct ContentView: View { var body: some View { Text(Text) .onAppear() { print(test) } } } test is printed in the console after a new build, and when I go to the Home Screen and return to the app, but if I swipe up from the bottom, and then swipe up from the menu of apps to close the app, it does not print upon opening the app again. What would be an example of code that does run under the circumstance of fully quitting the app and opening it again?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
5d
iOS Simulators Fail Download
I've been going through different fixes for a few weeks and nothing seems to work. Prior to updating everything to iOS 26 and OS 26, everything worked normally except for the predictive code which wouldn't download. Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = 2026-01-02 23:41:12 +0000; } Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 23C54; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 User Info: { checkConfiguration = 1; } System Information macOS Version 26.0 (Build 25A354) Xcode 26.2 (24553) (Build 17C52) Timestamp: 2026-01-02T16:41:12-07:00 What I've Tried Cleared caches Restarted my machine Reinstalled Xcode Installed other versions of Xcode Installed Xcode-beta
1
0
172
5d
Displaying spatial photos and videos on web pages in Safari
The purpose is to create a simple web-based gallery of spatial photos and videos using static html files. I have successfully displayed spatial photos using the img tag and IMG.heic files. I can tap and hold the image to bring up the contextual menu and from there select View Spatial Photo. Is there any way to add a control to the image, like a link or overlay on the image itself, that a user can simply tap to show the image in 3D? And how to host a video file on a web page without going through a CDN/streaming service? Sample html would be much appreciated.
1
0
687
5d
Reply to Displaying spatial photos and videos on web pages in Safari
Hey @DevForumPstr, Thanks for your questions. Please take a look at Optimize for the spatial web from WWDC24. This session introduces you to showing spatial photos on the web the using the element.requestFullscreen() method invoked by a user event. Additionally, you'll want also watch What’s new for the spatial web from WWDC25. This session covers presenting immersive video. You can embed this media on your website using the existing video element. For 180º, 360º, and wide field-of-view media, the file should conform to APMP. To learn more about APMP, watch Learn about the Apple Projected Media Profile. Let me know if you have additional questions, Michael
5d
When trying to run SwiftUI previews, it fails with "SimulatorShutdownUnexpectedlyError - Simulator was shutdown during an update"
My main app target builds fine and can run on Simulator without issue. Whenever I try to run a Preview, I get this error: == DATE: Monday, November 3, 2025 at 2:52:23 PM Pacific Standard Time 2025-11-03T22:52:23Z == PREVIEW UPDATE ERROR: SimulatorShutdownUnexpectedlyError: Simulator was shutdown during an update Simulator [F85A5AF1-F52C-4662-AFCD-762F87AF537D] failed to boot and may have crashed. This seems like it started happening after updating to MacOS 26. I've tried reinstalling all Simulators, tried on Xcode 26, deleted derived data, restarted Xcode and my Mac several times. What other troubleshooting steps can I take?
4
0
137
5d
Reply to Unable to download iOS simulator runtime 26.x on Xcode
Thanks for your post. It appears that you are experiencing difficulties downloading the iOS 26 simulator runtime, which is hindering your ability to compile and test your code. Are you utilizing the most recent version of Xcode from the App Store? The versions on your log file show that you are. The issue seems to be related to a network connection. As it seems can dns com.apple.MobileAsset.iOSSimulatorRuntime? Please ensure that your network connection is stable and that there are no firewalls or network settings obstructing access to Apple’s servers. The error messages indicate a failure to establish a connection to a host, which may be attributed to network-related issues. Although your setup appears compatible, it is advisable to verify that macOS 26.1 and Xcode 26.2 are fully updated. Occasionally, point updates can resolve unforeseen issues with downloads or simulator installations. Attempt restarting your router, modem, and Mac to eliminate any temporary network glitches that may be interferin
5d
iOS React Native: Can two WebRTC stacks (Wazo & Jitsi) share media?
Hi everyone, I’m building a React Native iOS app where I’m integrating Wazo (native WebRTC) and Jitsi (WebView / WebRTC). Use case: Wazo is used to maintain a background call session (mainly signaling + audio keep-alive). Jitsi is used in the foreground for video calls. Problem: When Jitsi starts, it takes control of the microphone and camera. The Wazo call disconnects after ~5 minutes (likely due to media / audio session conflict). Even if Wazo audio/video is muted or tracks are disabled, the session still drops. My questions: Is it officially supported or recommended to run two WebRTC stacks (Wazo + Jitsi) simultaneously on iOS? Can Wazo stay connected without active audio/video tracks while Jitsi uses mic/camera? Is there a way to release Wazo media streams temporarily (but keep signaling alive) while Jitsi is loading or active? Are there any AVAudioSession / background mode limitations on iOS that make this impossible by design? If this is not supported, what is the recommended architecture (sing
1
0
302
5d
SwiftData crash on adding sort argument to Query
Experiencing a crash that is only reproducible on TestFlight or AppStore version of the app, note this does not happen when running from Xcode. I've isolated the problem to sort argument being added to @Query that fetches a model that sorts based on inherited property. To reproduce: @Model class SuperModel { var createdAt: Date = .now } @available(macOS 26.0, *) @Model class SubModel: SuperModel { } @Query(sort: SubModel.createdAt, animation: .default) private var models: [SubModel]
1
0
48
5d
Reply to SwiftUI using Mac Catalyst destination the destination but provided destination is iPhone 17 Pro
Thank you for your post. May I request that you create a focused sample that developers in the forums can run and observe the results? When running a SwiftUI app designed for iPad on Mac Catalyst, it can be challenging to ensure that the UI scales appropriately and fills the available screen space. However I am confused your iPad target is an iPhone 17? Ensure that your main view is set to expand and fill the available space. You can try using to understand the available space and adjust your layout accordingly. Mac Catalyst provides specific modifiers and environment values you can leverage to better adapt your UI. Ensure that the Mac Catalyst app’s window toolbar isn’t consuming excessive space or causing layout issues. Test your app with different Mac resolutions or window sizes to confirm whether the layout issue is specific to certain dimensions or more general. Since you are using Xcode 26.2 (17C52), ensure that you are also on the latest version of macOS. I look forward to seeing your
Topic: UI Frameworks SubTopic: SwiftUI Tags:
5d
Reply to In app purchases
// StoreView.swift import StoreKit import SwiftUI struct StoreView: View { @ObservedObject private var storeController = StoreActor.shared.productController var hasPro: Bool { storeController.isEntitled } var body: some View { if let product = storeController.product, !storeController.isEntitled { // Pro features available to the user TO PURCHASE if(product.displayName == ProductNames.pro.humanReadablePurchaseLevel()) { // Show the product in a nice way, using the properties of the `product` variable ProductRow(product: product) } } if(hasPro) { // The user has already purchased the pro version, so show the pro features } } } struct ProductRow: View { @ObservedObject private var storeController = StoreActor.shared.productController var product: Product var body: some View { Text(Upgrade to (product.displayName)) Text(product.description) // Purchase button Button { Task(priority: .userInitiated) { await storeController.purchase() } } label: { Text((product.displayPrice)) } } }
5d
Exporting and re-importing ECC keys with file-based keychain
I'm trying to export and re-import a P-256 private key that was originally generated via SecKeyCreateRandomKey(), but I keep running into roadblocks. The key is simply exported via SecItemExport() with format formatWrappedPKCS8, and I did set a password just to be sure. Do note that I must use the file-based keychain, as the data protection keychain requires a restricted entitlement and I'm not going to pay a yearly fee just to securely store some private keys for a personal project. The 7-day limit for unsigned/self-signed binaries isn't feasible either. Here's pretty much everything I could think of trying: Simply using SecItemImport() does import the key, but I cannot set kSecAttrLabel and more importantly: kSecAttrApplicationTag. There just isn't any way to pass these attributes upfront, so it's always imported as Imported Private Key with an empty comment. Keys don't support many attributes to begin with and I need something that's unique to my program but shared across all the relevant key entr
4
0
990
5d
App Clips Causing CPSErrorDomain error 2 on Non App Clip URLs
Unexpected behavior encountered when scanning NFC tags. Imagine a link shortener web service where users can create lots of different URLs that are hosted on the same domain eg, https://short.com/unique-path The service has optional App Clip capability -- users can select any of their links and have the service create an App Clip for the selected link(s). Users can encode their URLs into NFC tags and have their customers scan NFC tags. Let's take just two URLs for example: https://short.com/foo https://short.com/bar The /foo link does have an App Clip associated with it while /bar does not have it. Each link has been encoded into appropriate NFC tag. Expected behavior when scanning from an iPhone: /foo -- shows an App Clip popup. /bar -- shows a Open in Safari default notification. What's actually happening /foo -- opens App Clip poput with correct metadata (title, subtitle, image) which is totally expected behavior. /bar (the one that doesn't have app clip associated with it) -- opens an Ap
17
0
718
5d
Reply to XProtect makes app hang when running an AppleScript
Oh, one more thing. That dispatch_sync call being made by XProtect is doing some one-time initialisation. That initialisation has to be done on the main thread. So, you might be able to work around this by forcing that initialisation to run on the main thread in advance of all this secondary thread work. An easy way to do that would be to use NSAppleScript to run a trivial script from the main thread as part of your app init sequence. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Privacy & Security SubTopic: General Tags:
6d
Reply to XProtect makes app hang when running an AppleScript
Thanks for attaching a sysdiagnose log to your bug (FB21334477). I took a look at the enclosed spin dump and I see this: Thread 0x222f6b 180 samples (216-395) priority 31 (base 31) cpu time 0.016s (43.3M cycles, 111.3M in… 180 thread_start + 8 (libsystem_pthread.dylib + 7080) [0x19ea8cba8] 180 _pthread_start + 136 (libsystem_pthread.dylib + 27656) [0x19ea91c08] 180 ??? (XojoFramework + 1309844) [0x10569bc94] 180 ??? (XojoFramework + 2624740) [0x1057dcce4] … redacted … 180 -[NSAppleScript compileAndReturnError:] + 136 (Foundation + 9808488) [0x1a0c7da68] 180 OSACompile + 52 (OpenScripting + 78068) [0x1bffa30f4] 180 SecurityPolicyTestDescriptor + 152 (OpenScripting + 8836) [0x1bff92284] 180 _SecurityPolicyTest(char const*, void const*, unsigned long) + 332 (OpenScripting + 8472) … 180 InterpreterSecurity_ScanBuffer + 112 (libInterpreterSecurity.dylib + 4868) [0x298e39304] 180 -[InterpreterSecurity scanData:withSourceURL:] + 164 (libInterpreterSecurity.dylib + 3… 180 -[XProtectScan beginAnalysisWithFeedback:] +
Topic: Privacy & Security SubTopic: General Tags:
6d
Reply to iOS UserDefaults Intermittently Returns Nil After getPreferences() Call - Race Condition?
Looking at the code you posted, the only way [1] that preferences can be nil at line 15 is if your decoded object code fails. You didn’t show that code, so it’s hard to tell what’s going on there. It sounds like you can reproduce this reasonably reliably. Given that, you can debug this using logging. I have general advice on that topic in Testing and Debugging Code Running in the Background. IMPORTANT It’s time to stop using NSLog habitually. Rather, use print(…) for transient debugging and Logger for debugging that you want to keep in your codebase (or for cases like this, where you need to debug without Xcode being attached). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] Well, not the only way. You could be dealing with an issue that’s outside of the scope of the Objective-C / Swift execution models, like a memory corruption problem. However, let’s rule out the easy things first (-:
Topic: App & System Services SubTopic: General Tags:
6d