I got users feed back, sometimes they seem the launch screen after active from background, and the launch screen show more longer than the cold launch. I check the app's log, when this issue happens, it displays a view controller named 'STKPrewarmingViewController', and disappears after about 5 seconds. And form the normal users, app don't have same behavior. It seems app need prewarming after back from background, why?
Devices System version: iOS 18.4, app build with Xcode 16.
How to fixed this issues?
Thanks!
Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
[Also submitted as FB20262774. Posting here in hopes of saving someone else from burning half a day chasing this down.]
Dynamic scaling of an Image() in a Button(), incorrectly decreases when transitioning from *** Large to AX 1 accessibility text sizes, instead of continuing to grow as expected. This occurs both on device and in the simulator, in iOS 18.6 and iOS 26.
Repro Steps
Create a project with sample code below
Show the preview if not showing
In Xcode Preview, click Canvas Device Settings and change Dynamic Type from *** Large to AX 1
Sample Code
struct ContentView: View {
var body: some View {
VStack(spacing: 30) {
Text("Button Image Scaling Issue")
.font(.system(size: 24, weight: .semibold))
Text("Switch dynamic type from ***** Large** to **AX 1**. The **Button** icon shrinks while the **No Button** icon grows.")
.font(.system(size: 14, weight: .regular))
TestView(title: "No Button", isButton: false)
TestView(title: "Button", isButton: true)
}
.padding()
}
}
struct TestView: View {
let title: String
let isButton: Bool
var body: some View {
VStack {
Text(title)
.font(.system(size: 16))
.foregroundColor(.secondary)
if isButton {
Button {} label: {
Image(systemName: "divide")
.font(.system(.largeTitle))
}
.buttonStyle(.bordered)
.frame(height: 50)
} else {
Image(systemName: "divide")
.font(.system(.largeTitle))
.foregroundColor(.blue)
.frame(height: 50)
.background(Color.gray.opacity(0.2))
}
}
}
}
Expected Result
Both the button and non-button images should continue to scale up proportionally when moving to larger accessibility text sizes.
Actual Result
When going from *** Large to AX 1…
Non-button image gets larger ✅
Button image gets smaller ❌
Screen Recording
System Info
Xcode Version 26.0 (17A321)
iOS 26.0 and 18.6
I'm currently I'm working on an iOS app + custom keyboard extension, and I’m hoping to get some insight into how to best architect a workflow where the keyboard acts as a remote trigger for dictation, but the main app handles the actual microphone recording and transcription.
I know that third-party keyboards are sandboxed and can’t access the microphone directly, so the pattern I’m following is similar to what Wispr Flow appears to be doing:
What I'm Trying to Build
The user taps a mic button in the custom keyboard (installed system-wide).
This triggers the main app to open, start a recording session, and send the audio to my transcription endpoint (not using Speech.framework).
Once the transcription result is ready, it's stored in an App Group shared container.
The keyboard extension polls for or receives the transcribed text and inserts it into the current input field via textDocumentProxy.insertText(...).
Key Questions
Triggering App Dictation from Keyboard
Is there a clean system-native way to transition from the keyboard to the main app and back?
Are there best practices around?:
Preventing jarring transitions (keyboard disappearing)?
Letting the app record in the background once triggered (see below)?
Keeping the App Alive During Audio Recording
Once the main app is opened to handle the dictation:
I want it to record audio continuously (sometimes for up to a minute or 2 ), send it to an external transcription API, and return the result.
However, from what I have read, iOS aggressively suspends or kills apps that are not in the foreground or haven’t requested the correct background modes - especially if there are background tasks running for longer than 30 seconds.
Even with audio enabled in Background Modes and a live AVAudioEngine session, I find that the app is sometimes paused or killed after a few seconds; especially when the user switches back to the app where they want to type.
But apps like Wispr Flow seem to manage this well. Their flow allows the user to record voice and insert it seamlessly without the app being terminated mid-recording.
So:
✅ How do I prevent my app from being killed/suspended while it's recording, especially when the user switches back to the original app?
Do I need:
A background AVAudioSession hack?
Audio playback tricks (e.g. silent audio)?
A workaround using CallKit (some apps seem to use it for persistent audio sessions)?
Something else Apple allows but doesn’t document clearly (or I am just a bad sercher)?
Returning Text to the Keyboard Extension
I’m using UserDefaults(suiteName:) in the App Group to pass the transcription result. Is that still the recommended approach?
Would it be better to use a shared file (for larger data or richer metadata)?
Are there any timing issues I should be aware of, e.g. like race conditions, stale reads, etc.?
We have a commercial video application in App Store, using a timer to refresh incoming video (NDI) 25-60 times a second. The signal comes from PTZ cameras, so besides Joystick, Gamecontroller and Stream Deck interfaces the app supports the mouse to control pan and zoom of the camera. We are using a NSPanGestureRecognizer for such a control. Worked fine for years - until macOS 26. In Tahoe the NSPanGestureRecognizer blocks the main thread, the timer function does not get called, so the user can still move the camera, but gets no video updates while dragging the control.
I think this is heavy bug in macOS 26, but I also see no way for a workaround.
So I was quite disappointed, that Apple today released Tahoe, being aware that this bug exists (Feedback Assistent: Similar recent reports: 10, Solution: open).
Any idea what to do besides warning the user not to install Tahoe when using the mouse?
Topic:
UI Frameworks
SubTopic:
AppKit
Hi!
I'm using PDFKits PdfView to display a PDF file and after several page changes, the background turns black, suddenly (like a big black rectangle). The error occurs in the Books App on the iPad as well and looks similiar to this issue:
https://discussions.apple.com/thread/8627073?sortBy=rank
Anyone got a solution for this?
I’m using the new preferredTransition = .zoom(...) API introduced in iOS 18.
Here’s a simplified version of what I do on app startup:
let listVC = CollectionViewController(collectionViewLayout: layout)
let detailVC = DetailViewController()
detailVC.preferredTransition = .zoom(sourceViewProvider: { context in
let indexPath = IndexPath(row: 0, section: 0)
let cell = listVC.collectionView.cellForItem(at: indexPath)
return cell
})
let nav = UINavigationController()
nav.setViewControllers([listVC, detailVC], animated: false)
window?.rootViewController = nav
window?.makeKeyAndVisible()
This is meant to restore the UI state from a previous session — the app should launch directly into the DetailViewController.
The Problem
When I launch the app with setViewControllers([listVC, detailVC], animated: false), the transition from listVC to detailVC appears correctly (i.e., no animation, as intended), but the drag-to-dismiss gesture does not work. The back button appears, and tapping it correctly triggers the zoom-out transition back to the cell, so the preferredTransition = .zoom(...) itself is properly configured.
Interestingly, if I delay the push with a DispatchQueue.main.async and instead do:
nav.setViewControllers([listVC], animated: false)
DispatchQueue.main.async {
nav.pushViewController(detailVC, animated: true)
}
…then everything works perfectly — including the interactive swipe-to-dismiss gesture — but that introduces an unwanted visual artifact: the user briefly sees the listVC, and then it pushes to detailVC, which I’m trying to avoid.
My Question
Is there a way to enable the swipe-to-dismiss gesture when using setViewControllers([listVC, detailVC], animated: false)
It can be very confusing for users if swipe-to-dismiss only works in certain cases inconsistently.
Thanks
Hi all,
In my AppKit app, I sometimes simulate events programmatically, for example:
func simulateKeyPress(characters: String, keyCode: UInt16) {
guard let keyDown = NSEvent.keyEvent(
with: .keyDown,
location: .zero,
modifierFlags: [],
timestamp: 0,
windowNumber: NSApp.mainWindow?.windowNumber ?? 0,
context: nil,
characters: characters,
charactersIgnoringModifiers: characters,
isARepeat: false,
keyCode: keyCode
) else { return }
NSApp.postEvent(keyDown, atStart: false)
}
At the same time, I install a local event monitor:
NSEvent.addLocalMonitorForEvents(matching: .any) { event in
// Ideally, detect whether this event came from a real user
// (mouse, keyboard, trackpad, etc.)
// or was programmatically generated via NSEvent + postEvent.
return event
}
The problem:
Events I generate with NSEvent.* factory methods and post using NSApp.postEvent look the same as real system events when received in the monitor.
My question:
Is there a supported way to tell whether an incoming NSEvent is system/user-generated vs programmatically posted?
Using the new iOS 26 SwiftUI WebView, is it possible to print (to a physical printer) like we can with WKWebView with UIPrintInteractionController? The documentation for WebView and WebPage seems to skip over printing entirely. If not, and it uses WKWebView under the hood, is there a way to access to it so we could use UIPrintInteractionController? Thanks!!
Topic:
UI Frameworks
SubTopic:
SwiftUI
Code that disables a tab bar item via UITabBarItem.isEnabled = false used to both grey out the item and block taps on iOS 18. On iOS 26, the item often remains tappable and selectable, even though isEnabled is set to false. This looks like a behavior change or regression.
func disableTabbarItems(tabbar: UITabBarController, isEnable: Bool, index: Int) {
if let tabItems = tabbar.tabBar.items, index < tabItems.count {
let tabItem = tabItems[index]
tabItem.isEnabled = isEnable
}
}
iOS 18
iOS 26
Hi everyone,
I’ve run into a strange localization issue with macOS document-based apps in SwiftUI/AppKit. I created a standard document-based macOS app in Xcode (SwiftUI template) and added a French localization to the project.
All system-generated menu bar commands (File → New, Close, Print, etc.) are correctly translated into French… except for “Save”, which remains in English.
To rule out problems in my own code, I created a fresh, unmodified document-based app project in Xcode, and immediately added French localization without touching any code. Same result: all commands are translated except “Save”.
This suggests the issue isn’t specific to my app code, but either the project template, or possibly macOS itself.
My environment
• Xcode version: 16.4
• macOS version: 15.6.1 Sequoia]
• Swift: Swift 6
Questions
1. Has anyone else seen this issue with the “Save” command not being localized?
2. Is this expected behavior (maybe “Save” is handled differently from other menu items)?
3. If it’s a bug in the template or OS, is there a known workaround?
Thanks for any insights
P.S. Please note that I'm a total beginner
When displaying a view with a Button inside a ScrollView using the sheet modifier, if you try to close the sheet by swiping and your finger is touching the Button, the touch is not canceled.
This issue occurs when building with Xcode 16 but does not occur when building with Xcode 15.
Here is screen cast.
https://drive.google.com/file/d/1GaOjggWxvjDY38My4JEl-URyik928iBT/view?usp=sharing
Code
struct ContentView: View {
@State var isModalPresented: Bool = false
var body: some View {
ScrollView {
Button {
debugPrint("Hello")
isModalPresented.toggle()
} label: {
Text("Hello")
.frame(height: 44)
}
Button {
debugPrint("World")
} label: {
Text("World")
.frame(height: 44)
}
Text("Hoge")
.frame(height: 44)
.contentShape(Rectangle())
.onTapGesture {
debugPrint("Hoge")
}
}
.sheet(isPresented: $isModalPresented) {
ContentView()
}
}
}
create a sample XCode project using Objective-C and stroybook (xib) using latest XCode beta
open MainMenu.xib, and select Main Menu → File → Print...
remove the image like below
4. build it
5. run it on macOS 26 beta 7
6. The menu item "print.." still have "Image"
Is there any way to remove image for one menu item.
I have also tried NSMenuItem.image = nil, but still not work.
The issue I met on my own app is that I cannot remove icons for "Zoom In", "Zoom Out" and many other menu items, which makes the menu items not aligned properly.
Code that disables a tab bar item via UITabBarItem.isEnabled = false used to both grey out the item and block taps on iOS 18. On iOS 26, the item often remains tappable and selectable, even though isEnabled is set to false. This looks like a behavior change or regression.
func disableTabbarItems(tabbar: UITabBarController, isEnable: Bool, index: Int) {
if let tabItems = tabbar.tabBar.items {
let tabItem = tabItems[index] tabItem.isEnabled = isEnable
}

}

My app encountered a crash problem. The analysis stack seems to be related to the keyboard. The system keyboard code is unresponsive for a long time until it crash. The feature of the stack, BrowserEngineKit, seems to indicate the webview scene. Xcode debugging found that tap the input box on the webview page can reproduce the same stack as the crash, but the crash cannot be reproduced. I noticed a feedback link https://developer.apple.com/forums/thread/784718, which is the same as the top of the crash stack I encountered, so the root cause of the problem may be similar, caused by the locking operation related to UIKeyboardTaskQueue. Hope to give some suggestions. Thanks.
crash log:
Incident Identifier: 39E3AFE6-43B1-4DE6-AC2B-D62C5EC89752
CrashReporter Key: AppleMetricKit
Hardware Model: iPhone17,2
Process: iAliexpress
Code Type: ARM-64
Parent Process: ? [1]
Date/Time: 2025-07-02 22:59:00
Launch Time: Unknown
OS Version: iPhone OS 18.1.1 (22B91)
Report Version: 104
Exception Type: EXC_CRASH
Exception Codes: KERN_SUCCESS
Triggered by Thread: 0
Application Specific Information:
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: app<com.alibaba.iAliexpress(A182346C-2A09-4082-9AAE-0EC7A1A1B5AB)>:2263 exhausted real (wall clock) time allowance of 10.00 seconds
ProcessVisibility: Unknown
ProcessState: Running
WatchdogEvent: scene-update
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 15.280 (user 9.430, system 5.850), 25% CPU",
"Elapsed application CPU time (seconds): 0.210, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001ea7f7f90 __psynch_cvwait :8 (in libsystem_kernel.dylib)
1 libsystem_pthread.dylib 0x000000022296aa7c _pthread_cond_wait :1248 (in libsystem_pthread.dylib)
2 Foundation 0x000000019908fa9c -[NSCondition waitUntilDate:] :132 (in Foundation)
3 Foundation 0x000000019908bea8 -[NSConditionLock lockWhenCondition:beforeDate:] :80 (in Foundation)
4 UIKitCore 0x000000019d05cbb4 -[UIKeyboardTaskQueue lockWhenReadyForMainThread] :784 (in UIKitCore)
5 UIKitCore 0x000000019d05c85c -[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] :160 (in UIKitCore)
6 UIKitCore 0x000000019d56720c -[_UIKeyboardStateManager prepareForSelectionChange] :128 (in UIKitCore)
7 UIKitCore 0x000000019d5674f4 -[_UIKeyboardStateManager selectionWillChange:] :72 (in UIKitCore)
8 BrowserEngineKit 0x0000000257671688 -[BETextInteraction selectionWillChange:] :84 (in BrowserEngineKit)
9 UIKitCore 0x000000019d75d654 -[UIAsyncTextInteraction selectionWillChange:] :68 (in UIKitCore)
10 UIKitCore 0x000000019dbae374 -[_UIKeyboardTextSelectionController beginSelectionChange] :64 (in UIKitCore)
11 UIKitCore 0x000000019df5fed0 -[UITextSelectionInteraction tappedToPositionCursorWithGesture:atPoint:granularity:completionHandler:] :476 (in UIKitCore)
12 UIKitCore 0x000000019df5f948 -[UITextSelectionInteraction _checkForRepeatedTap:gestureLocationOut:] :1072 (in UIKitCore)
13 UIKitCore 0x000000019df60488 -[UITextSelectionInteraction _handleMultiTapGesture:] :852 (in UIKitCore)
14 UIKitCore 0x000000019cf879cc -[UIApplication sendAction:to:from:forEvent:] :100 (in UIKitCore)
15 UIKitCore 0x000000019d84ce98 -[UITextMultiTapRecognizer onStateUpdate:] :280 (in UIKitCore)
16 UIKitCore 0x000000019cfb6ac4 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] :128 (in UIKitCore)
17 UIKitCore 0x000000019cfb6934 _UIGestureRecognizerSendTargetActions :92 (in UIKitCore)
18 UIKitCore 0x000000019cfb66f4 _UIGestureRecognizerSendActions :284 (in UIKitCore)
19 UIKitCore 0x000000019cc69b28 -[UIGestureRecognizer _updateGestureForActiveEvents] :572 (in UIKitCore)
20 UIKitCore 0x000000019cc3b724 _UIGestureEnvironmentUpdate :2488 (in UIKitCore)
21 UIKitCore 0x000000019cd2fa00 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] :336 (in UIKitCore)
22 UIKitCore 0x000000019cecffe4 -[UIGestureEnvironment _updateForEvent:window:] :188 (in UIKitCore)
23 UIKitCore 0x000000019cecf3c8 -[UIWindow sendEvent:] :2948 (in UIKitCore)
24 iAliexpress 0x0000000104e92000 -[UIWindow(AliHA) aliHASwizzledSendEvent:] UIWindow+AliHA.m:18 (in iAliexpress)
25 UIKitCore 0x000000019cd63b70 -[UIApplication sendEvent:] :376 (in UIKitCore)
26 iAliexpress 0x0000000104e91c84 -[UIApplication(SPM) alg_sendEvent:] AFSPMManager.m:0 (in iAliexpress)
27 UIKitCore 0x000000019cd6409c __dispatchPreprocessedEventFromEventQueue :1048 (in UIKitCore)
28 UIKitCore 0x000000019cd6df3c __processEventQueue :5696 (in UIKitCore)
29 UIKitCore 0x000000019cc66c60 updateCycleEntry :160 (in UIKitCore)
30 UIKitCore 0x000000019cc649d8 _UIUpdateSequenceRun :84 (in UIKitCore)
31 UIKitCore 0x000000019cc64628 schedulerStepScheduledMainSection :172 (in UIKitCore)
32 UIKitCore 0x000000019cc6559c runloopSourceCallback :92 (in UIKitCore)
33 CoreFoundation 0x000000019a434328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ :28 (in CoreFoundation)
34 CoreFoundation 0x000000019a4342bc __CFRunLoopDoSource0 :176 (in CoreFoundation)
35 CoreFoundation 0x000000019a431dc0 __CFRunLoopDoSources0 :244 (in CoreFoundation)
36 CoreFoundation 0x000000019a430fbc __CFRunLoopRun :840 (in CoreFoundation)
37 CoreFoundation 0x000000019a430830 CFRunLoopRunSpecific :588 (in CoreFoundation)
38 GraphicsServices 0x00000001e64101c4 GSEventRunModal :164 (in GraphicsServices)
39 UIKitCore 0x000000019cf96eb0 -[UIApplication _run] :816 (in UIKitCore)
40 UIKitCore 0x000000019d0455b4 UIApplicationMain :340 (in UIKitCore)
41 iAliexpress 0x0000000104e9b0b8 _main main.m:17 (in iAliexpress)
42 dyld 0x00000001bfe1eec8 start :2724 (in dyld)
Hi, I wanted to know what is the best way to detect whether a part of string has an unavailable character, '□' (tofu box or last resort character). So far it seems to be that we will have to parse all the strings and individually check for each character and whether or not it is a part of the Unicode Scalar. And since we are a business application that deals with a lot of data as strings, this will be rather performance heavy. So wanted to know if there were any other better or more efficient ways to go about this?
Hi all,
I’m subclassing UITextView and overriding insertText(_:) to intercept and log input:
class TWTextView: UITextView {
override func insertText(_ text: String) {
print("insertText() : \(text)")
super.insertText(text)
}
}
This works fine, but I’ve noticed that insertText(_:) is invoked both when:
The user types something in the text view (via hardware/software keyboard).
I programmatically call myTextView.insertText("Hello") from my own code.
I’d like to be able to distinguish between these two cases — i.e., know whether the call was triggered by the user or by my own programmatic insert.
Is there any recommended way or system-provided signal to differentiate this?
Thanks in advance!
I tried the new WebView api in swiftui and tried to pass webPage for this view to be able to control the navigation of the user by giving him the option to go back or forward using nav buttons but the view doesn't get's updated when the webPage.backForwardList.backList so the buttons remains disabled.
code snippet:
@available(iOS 26, *)
struct LinkWebViewFor26: View {
let url: URL
@State var webPage = WebPage()
@Environment(\.dismiss) private var dismiss
var body: some View {
WebView(webPage)
.webViewBackForwardNavigationGestures(.disabled)
.task { webPage.load(url) }
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button {
dismiss()
} label: {
Image(systemName: "checkmark")
}
.buttonStyle(.glassProminent)
}
ToolbarItemGroup(placement: .topBarLeading) {
BackForwardMenu(
list: webPage.backForwardList.backList,
label: .init(text: "Backward", systemImage: "chevron.backward")
) { item in
webPage.load(item)
}
BackForwardMenu(
list: webPage.backForwardList.forwardList.reversed(),
label: .init(text: "Forward", systemImage: "chevron.forward")
) { item in
webPage.load(item)
}
}
}
.onChange(of: webPage.backForwardList) { _, _ in
print(webPage.backForwardList.backList)
}
}
}
I have a simple task, to measure the height of the overlapping area occupied by the keyboard in the current view. In the attached images, I use it to position a UITextView (red) above the keyboard, as a test.
The keyboard displays an inputAccessoryView (yellow) when editing a text view, but it’s also summoned by a UIFindInteraction, which shows a search bar above the keyboard. When measuring the keyboard, I need to account for either the accessory view or the search bar, basically, the total keyboard height including any extra views above it.
I use the usual algorithm: the keyboard frame from UIResponder.keyboardWillShowNotification (documented as being in screen coordinates) is converted to my view’s coordinates and intersected with the view’s bounds to get the overlapping height.
The first issue: in windowed mode, the keyboard frame reports a negative origin.x (e.g. -247), even though in screen coordinates it should start at 0. I display the raw frame in the navbar, as shown in the first screenshot.
I then suspected the frame might be in window coordinates on iOS 26, but repositioning the window a few times, and switching between find interaction keyboard and text editing keyboard, sometimes yields a positive origin.x instead, as if the keyboard starts from the middle of the screen!? (see the second screenshot).
And in some cases, the raw keyboard height is even 0, despite the keyboard clearly being visible and taking space (third screenshot).
Interestingly, the reported frame for the search keyboard is always consistent and in screen coordinates, but the default keyboard frame just doesn’t make sense.
Right now, the traffic light buttons overlapped on my iPad app top corner on windows mode (full screen is fine).
How do I properly design my app to avoid the traffic light buttons? Detect that it is iPadOS 26?
Topic:
UI Frameworks
SubTopic:
SwiftUI
I currently have a SwiftUI TabView that has 5 Tab's. The first tab has a UIScrollView in a UIViewRepresentible with scrollView.scrollsToTop = false and that works fine for when the user hits the navigation bar, however if the user taps the first tab when it is already selected my UIScrollView scrolls to top.
My UIScrollView is essentially 5 views, a center view, top, bottom, right, and left view. All views except for the center are offscreen but available for the user to scroll horizontal or vertical (and the respective views get updated based on the new center view).
The issue I have is that clicking the first tab when its already selected, sets the content offset (for the y axis) to 0, which messes me up 2x, first it scrolls up but since its not really scrolling the right, left, and upper views dont exist, which makes the user think it can't be scrolled or it's broken.
For now I subclassed UIScrollView like this
class NoScrollToTopScrollView: UIScrollView {
override func setContentOffset(_ contentOffset: CGPoint, animated: Bool) {
if contentOffset.y == .zero {
// Ignore SwiftUI’s re-tap scroll-to-top
return
}
super.setContentOffset(contentOffset, animated: animated)
}
}
which seems to work, but I'm just wondering if there is a better way to do this, or maybe a way to disable SwiftUI Tab from doing its default action which can help with a SwiftUI ScrollView as well?