Search results for

show when run

112,670 results found

Post

Replies

Boosts

Views

Activity

Reply to Activating a Container App from a Custom Keyboard Extension to Enable Continuous Voice Input While Preserving the Original Typing Context
I see the community bringing this up from time to time, and so would like to take this chance to hopefully get it sorted. For the clarify of the discussion, I'd split this question into three parts: Does App Review guideline allow a keyboard extension to launch its container app? If yes, is there any API to do so? Is there any API for the container app to bring the host app back to the foreground? The first part is about App Review policy, and so only the App Review team has the final answer, but looking into the App Review Guideline, you can see the following related to keyboard extensions: 4.4.1 Keyboard extensions have some additional rules. ... They must not: Launch other apps besides Settings; Here the guideline uses other apps, rather than simply apps or any app. I believe that means to say that launching the container app is allowed. To make sure my understanding is correct, I've reached out my App Review colleague, and they've confirmed that launching the container app from a keyboard extension (to do
Topic: App & System Services SubTopic: General Tags:
5d
How to correctly move a TextField selection cursor when inserting UTF16 text
I'm trying to implement a feature whereby a user can tap a button to insert a character at the cursor in a TextField - the cursor then needs to be moved forward to be in front of the insert character. I'm having trouble with characters such as π which are UTF16 encoded. In the following sample app, enter the following sequence: Enter 9 by keyboard tap + Enter 9 by keyboard tap π Enter 9 via keyboard tap + he TextField will show '9+9π+9' (i.e. the final + is inserted before 9 rather than after it. Any insight into what I am doing wrong? import SwiftUI @main struct TextInsertApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var text: String = @State private var selection: TextSelection? = nil var body: some View { TextField(, text: $text, selection: $selection) .background(.gray.opacity(0.4)) Button(+) { insert(+) } Button(π) { insert(π) } } func insert(_ insertString: String) { if let selection { if case let .selection(range) = selection.ind
1
0
150
5d
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
NSPathControl -setURL: crash on macOS Tahoe
I received the following crash: Thread 0 Crashed: libsystem_kernel.dylib __pthread_kill + 8 libsystem_pthread.dylib pthread_kill + 296 (pthread.c:1721) libsystem_c.dylib abort + 124 (abort.c:122) libc++abi.dylib __abort_message + 132 (abort_message.cpp:66) libc++abi.dylib demangling_terminate_handler() + 304 (cxa_default_handlers.cpp:76) libobjc.A.dylib _objc_terminate() + 156 (objc-exception.mm:496) libc++abi.dylib std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59) libc++abi.dylib __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88 (cxa_exception.cpp:152) libc++abi.dylib __cxa_throw + 92 (cxa_exception.cpp:299) libobjc.A.dylib objc_exception_throw + 448 (objc-exception.mm:385) Foundation -[NSConcreteMutableAttributedString initWithString:] + 268 (NSAttributedString.m:1049) CloudDocs -[BRCloudPathComponentDisplayMetadata initWithDisplayName:suffix:url:icon:] + 180 (BRCloudPathComponentDisplayMetadata.m:75) CloudDocs -[NSURL(BRCloudPathComponent) br_pathComponentDisplayMetadataWithOptions:]_block_
2
0
29
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
Can't specify platform version for xcodebuild download 26.x
Prior to iOS 26.0 we were able to download specific simulator runtimes from the command line by using a command like xcodebuild -downloadPlatform iOS -buildVersion 18.0 This is described in the documentation here. This no longer works for 26.x. If I run the following command: xcodebuild -downloadPlatform iOS -buildVersion 26.0 it fails with the following error: Finding content... iOS 26.0 is not available for download. If I omit the -buildVersion flag it will download the latest version, currently 26.2, but if I try and specify 26.2 as the buildVersion I still get iOS 26.2 is not available for download. This behavior has been confirmed on Xcode 26.2. Perhaps related, it appears these runtimes are also no longer being made available for download on https://developer.apple.com/download/all
0
0
38
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
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
Navigation title is not visible in root of navigation stack of UITabBarController using UITab layout on iPad
Description Title of the view controller is not displayed for the 1st view controller in navigation stack. Is there a way to show it? Main problem is that selected tab is a UITabGroup and there's no way to understand which child of it is currently selected without opening the sidebar or guessing by the content. Human Interface Guidelines In the guidelines there are examples with title visible on the iPad in similar case: https://developer.apple.com/design/human-interface-guidelines/tab-bars Code import UIKit import SwiftUI struct TestView: View { var tab: UITab? let id = UUID() var body: some View { ScrollView { HStack { Spacer() VStack { Text(tab?.title ?? id.uuidString) } Spacer() } .frame(height: 1000) .background(.red) .onTapGesture { tab?.viewController?.navigationController?.pushViewController( TestViewController(nil), animated: true ) } } } } class TestViewController: UIHostingController { let _tab: UITab? init(_ tab: UITab?) { self._tab = tab super.init(rootView: TestView(tab: _tab)) } @MainA
Topic: UI Frameworks SubTopic: UIKit
4
0
233
5d
UNNotificationAttachment preview intermittently missing (attachment-store URL becomes unreadable)
I have been fighting this problem for two months and would love any help, advice or tips. Should I file a DTS ticket? Summary We attach a JPEG image to a local notification using UNNotificationAttachment. iOS reports the delivered notification as having attachments=1, but intermittently no image preview appears in Notification Center. In correlated cases, the attachment’s UNNotificationAttachment.url (which points into iOS’s attachment store) becomes unreadable (Data(contentsOf:) fails) even though the delivered notification still reports attachments=1. This document describes the investigation, evidence, and mitigations attempted. Product / Component UserNotifications framework UNNotificationAttachment rendering in Notification UI (Notification Center / banner / expanded preview) Environment App: OnThisDay (SwiftUI, Swift 6) Notifications: local notifications scheduled with UNCalendarNotificationTrigger(repeats: false) Attachment: JPEG generated from PhotoKit (PHImageManager.requestImage) and written to app
1
0
26
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
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
nable to Distribute iOS App to App Store – Archive Shows Only 'Distribute Content'
Hello Apple Developer Support Team, I am writing to request assistance with an issue preventing me from distributing my iOS app to the App Store. I am able to successfully build and archive my app in Xcode without errors. However, after archiving, Xcode only shows the option “Distribute Content” instead of “Distribute App”. Because of this, I am unable to upload the app to App Store Connect. App & Account Details • App Bundle Identifier: com.yesbuy.yesbuyapp • Team Name: Fathima Sayed Mohamed • Team ID: Z327MG963D • Xcode Version: 26.2 • macOS Version: macOS 15.6.1 Signing & Certificates • Signing Method: Automatically manage signing (enabled) • Signing Certificate (Release): Apple Distribution: Fathima Sayed Mohamed • Provisioning Profile: Xcode Managed / App Store Distribution • Archive Status: Build succeeded What I’ve Already Verified • The archive is created using Release configuration • Skip Install is set to No for the main app target (Runner) • The app target is selected correctly dur
1
0
72
5d
NSHostingView stops receiving mouse events when layered above another NSHostingView (macOS Tahoe 26.2)
I’m running into a problem with SwiftUI/AppKit event handling on macOS Tahoe 26.2. I have a layered view setup: Bottom: AppKit NSView (NSViewRepresentable) Middle: SwiftUI view in an NSHostingView with drag/tap gestures Top: Another SwiftUI view in an NSHostingView On macOS 26.2, the middle NSHostingView no longer receives mouse or drag events when the top NSHostingView is present. Events pass through to the AppKit view below. Removing the top layer immediately restores interaction. Everything works correctly on macOS Sequoia. I’ve posted a full reproducible example and detailed explanation on Stack Overflow, including a single-file demo: Stack Overflow post: https://stackoverflow.com/q/79862332 I also found a related older discussion here, but couldn’t get the suggested workaround to apply: https://developer.apple.com/forums/thread/759081 Any guidance would be appreciated. Thanks!
2
0
235
5d
nable to Distribute iOS App to App Store – Archive Shows Only 'Distribute Content'
Hello Apple Developer Support Team, I am writing to request assistance with an issue preventing me from distributing my iOS app to the App Store. I am able to successfully build and archive my app in Xcode without errors. However, after archiving, Xcode only shows the option “Distribute Content” instead of “Distribute App”. Because of this, I am unable to upload the app to App Store Connect. App & Account Details • App Bundle Identifier: com.yesbuy.yesbuyapp • Team Name: Fathima Sayed Mohamed • Team ID: Z327MG963D • Xcode Version: 26.2 • macOS Version: macOS 15.6.1 Signing & Certificates • Signing Method: Automatically manage signing (enabled) • Signing Certificate (Release): Apple Distribution: Fathima Sayed Mohamed • Provisioning Profile: Xcode Managed / App Store Distribution • Archive Status: Build succeeded What I’ve Already Verified • The archive is created using Release configuration • Skip Install is set to No for the main app target (Runner) • The app target is selected correctly dur
2
0
51
5d