Simplely, when we set UITextView.inputView and then call becomeFirstResponder, but the custom inputView could not show expectedly just like before. We test this code in iOS17 and below, while only iOS17 does not work.
And xcode console print these logs:
Failed to retrieve snapshot.
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID
-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID
Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked:
Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked:
Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked:
Unsupported action selector setShiftStatesNeededInDestination:autoShifted:shiftLocked:
General
RSS for tagExplore 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
In the section : Add transform logic to the main component
There is the line :
var state: GestureStateComponent = entity.gestureStateComponent ?? GestureStateComponent()
When I try to add the same line. I have the error cannot find GestureStateComponent in scope.
My imports :
import SwiftUI
import RealityKit
import RealityKitContent
An answer would be greatly appreciate it
In order to make referencing keys for localized strings a little more reliable, our application references generated constants for localized string keys:
This eliminates the potential for developers to misspell a key when referencing a localized strings. And because these constants are automatically generated by the exact same process that provides localized strings for the application, each and every constant is guaranteed to have a localized string associated with it.
I’m currently attempting to implement something similar for the localized strings referenced by our new App Intents. Our initial release of App Intent functionality is simply using string literals to reference localized strings:
However, I am running into several issues when trying to reference the string keys as a constant. The closest I managed to get was defining the constant as either a LocalizationValue or as a StaticString and referencing the constant while initializing the LocalizedStringResource. With this approach, I see no errors from Xcode until I try and compile. What’s more is that the wording of the error being thrown is quite peculiar:
As you can see with the sample code above, I am clearly calling LocalizedStringResource’s initializer directly as Indicated by the error.
Is what I’m trying to do even possible with App Intents? From my research, it does look like iOS app localization is moving more towards using string literals for localized strings. Like with String Catalog’s ability to automatically generate entries from strings referenced in UI without the need for a key. However, we’d prefer to use constants if possible for the reasons listed above.
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!
I integrated an Advanced App Clip Experience to my app. In trying to test the App Clip Card, the card does not appear when I tap the link on my device that is associated to the Advanced App Clip Experience.
Listed are some contextual information:
Testing on device running on iOS 18.3.1
Associated Domains:
Main target app: applinks:
App clips target app: applinks: and appclips:
Archived and uploaded build to App Store Connect.
Green "Testing" status via Testflight.
On Distribution tab, green "Valid" status for build domain.
Advanced App Clip Experience green "Received" status.
Developer App Clip Testing Diagnostics:
Green "Register Advanced Experience" status
Green "App Clip Code" status
Warning "App Clip Published on App Store"
Orange Circle "Associated Domains"
After looking at countless threads, I still cannot for the life of me find a solution to test the App Clip. Any guidance would be extremely appreciated. I had also submitted a support ticket with case ID #102552504973.
I read this doc and find some key info.
https://developer.apple.com/carplay/documentation/CarPlay-App-Programming-Guide.pdf
CarPlay app entitlements
All CarPlay apps require a CarPlay app entitlement that matches your app type. To request a CarPlay app entitlement, go to http://developer.apple.com/carplay and provide information about your app, including the type of entitlement that you are requesting. You also need to agree to the CarPlay Entitlement Addendum.
Apple will review your request. If your app meets the criteria for a CarPlay app, Apple will assign a CarPlay app entitlement to your Apple Developer account and notify you.
But I still have questions about the old and new CarPlay.
// About account permission
I have 2 Apple developer accounts.
Account A (normal dev account):
Here our app already supports the old-style CarPlay UI. (before iOS14)
And I can see there are "CarPlay Messaging App" and "CarPlay VoIP Calling App" in the "Additional Capabilities" tab in my Identifier.
Account B (Enterprise account):
I can see there is a "CarPlay Communication App" in the "Additional Capabilities" tab in my Identifier. But I don't know (or don't remember) if I have requested this new CarPlay entitlement for this account.
Quesiton 1: If I want to refactor my current CarPlay app (from old UI to new UI [iOS14 support]), Do I need to request the CarPlay entitlement for Account A?
Because I can not find the "CarPlay Communication App" in Account A portal(or via Xcode).
// About New CarPlay UI
In the old UI, there are just 2 buttons showing after user tap the App icon now.
One is for message and the other one is for VoIP call.
But I can see only one VoIP call button in the new CarPlay UI, no seperated message button.
Question2: Can I add a message button? If no, how to implement a similiar user experience.
Thanks.
We are looking at the possibility of launching our app through Siri with a locked device. We have the device responding to our App Intent but it is asking to be unlocked first. If the device is locked the intent works perfectly. It just doesn't seem to respect the set intentAuthenticationPolicy.
Thank you for you time looking into this.
We have set these var to .alwaysAllowed and open to true.
static var authenticationPolicy: IntentAuthenticationPolicy = .alwaysAllowed
static var openAppWhenRun: Bool = true
Here is our full test code:
import AppIntents
import SwiftUI
// MARK: - App Intents
struct OpenAppIntent: AppIntent {
static var title: LocalizedStringResource = "Open Main App"
static var description: IntentDescription? = .init(stringLiteral: "Opens the App")
static var authenticationPolicy: IntentAuthenticationPolicy = .alwaysAllowed
static var openAppWhenRun: Bool = true
func perform() async throws -> some IntentResult {
print("App opened")
return .result()
}
}
struct TestAppShortcutProvider: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: OpenAppIntent(),
phrases: [
"Begin \(.applicationName)"
],
shortTitle: "Open App",
systemImageName: "popcorn.fill"
)
}
}
I am using this syntax let surah_id = Expression("surah_id") but the system gives an error and suggesting to use let surah_id = Expression(value:"surah_id").
Is this syntax correct? If yes then I need to change multiple things as well to update these changes.
Thanks and I am looking forward to getting valuable answers.
Topic:
UI Frameworks
SubTopic:
General
Hello,
I am new to App Clip development. I have uploaded a build with app clip to App Store Connect and the build is visible on the TestFlight. I am able to open the App Clip via TestFlight and I do see everything working, but the app clip is not getting added in Recent Apps folder and is no where found on the device. If I want to launch the app clip again, I have to scan the QR code again.
When I use other app clips, like Panera Bread, the app clip stays in my Recent App/Recently Added folder.
My app clip size is close to 75MB. Is the app clip not in Recently Added folder because the app clip is installed from TestFlight or is it happening because of the app clip size?
Thanks!
My app started crashing since iOS 18.4 update. Crashes started happening in 18.4 beta and are still happening in the official 18.4 RTM build (22E240). Crash is happening randomly and I cannot reproduce it, but it affects a few percent of users.
As you can see in log, crash happen when NSAttributedString is loading HTML with init(data:options:documentAttributes:) with .html documentType.
Crash-2025-04-02-154720.ips
Hi everyone! I am having a bit of trouble with why my Map() is overwriting my customized tabBar settings. Specifically my tab bar background. (White -> Black)
Map(position: $cameraPosition) {
UserAnnotation()
}
.toolbarBackground(.hidden, for: .tabBar)
This above ^ is a view which acts as a tab view for my tab bar. I have customized my tab bar as follows just so it was obvious to see me changes.
let tabAppearance = UITabBarAppearance()
tabAppearance.configureWithOpaqueBackground()
tabAppearance.backgroundColor = .white
UITabBar.appearance().standardAppearance = tabAppearance
UITabBar.appearance().scrollEdgeAppearance = tabAppearance
I have tried implementing solutions which is seen with my .toolbar attempt but nothing has help. I would like the tab bar to be consistent with all of my views and from my understanding the Map is overwriting those settings.
How should I program the globe key? If possible, could you teach me in C language?
Topic:
UI Frameworks
SubTopic:
General
My App Clip is associated with three domains:
• nfc.ttwifi.net
• qr.ttwifi.net
Currently, I’m experiencing an issue where scanning a QR code from qr.ttwifi.net correctly launches my App Clip. However, when I scan a QR code from nfc.ttwifi.net, it successfully displays the App Clip card but then shows the message “App Clip unavailable.”
I checked the Website Status in App Store Connect, and both domains have their Debugging Status and Cache Status marked as Verified.
One important detail to note:
Yesterday, while submitting a new version for review, I noticed that nfc.ttwifi.net showed “Unable to connect to AASA file” in the Cache Status in App Store Connect.
The cache status update time was March 27, 2025, at 6:52 PM.
However, when I checked today, both domains appeared to be fine, and the cache status update time was March 27, 2025, at 7:07 PM.
How can I restore the App Clip functionality for my nfc.ttwifi.net domain?
The Problem
Push buttons (created as a PDFAnnotation using PDFKit) do not properly write the associated caption's key-value pair (within the annotation's appearance characteristics dictionary) to a PDF document.
What is Happening
Push button widget annotations can have a caption that is displayed as the button’s label.
In the PDF 1.7 specification (ISO PDF32000-2008, s. 12.5.6.19), a widget annotation can have an ‘appearance characteristics dictionary’ (MK) with properties to construct the appearance of the widget. The caption property (CA) is used to construct a button’s caption/label.
PDFKit uses the PDFAnnotation .caption property to set the value of a push button’s caption as a string.
Observation 1:
In an open PDF document (using PDFView), a push button widget annotation can be created and added to a PDFPage using the following code:
let pushButton = PDFAnnotation(bounds: pushButtonBounds, forType: .widget, withProperties: nil)
pushButton.widgetFieldType = .button
pushButton.widgetControlType = .pushButtonControl
pushButton.caption = "My Button"
page.addAnnotation(pushButton)
The PDFAnnotation .caption property is used to set the caption to the required string. As a result, the push button is correctly displayed on the PDFPage with the correct label being display on the button.
While the PDF document remains open, the appearance characteristics dictionary (an PDFAppearanceCharacteristics object) retains a key-value pair for the caption with the correct value as expected.
On saving/writing to the PDF file, however, the key-value pair for the caption in the appearance characteristics dictionary is not written to the PDF document’s file.
Resulting PDF markup:
6 0 obj
<< /Rect [ 256 299.8977 356 399.8977 ] /Border [ 0 0 0 ] /T (button23) /F
4 /Subtype /Widget /DA (/.AppleSystemUIFont 13 Tf 0 g) /MK 8 0 R /C [ 0 ]
/AP 9 0 R /V /Off /M (D:20250330154918Z00'00') /FT /Btn /Type /Annot /Ff 65536
>>
endobj
9 0 obj
<< /N 10 0 R >>
endobj
8 0 obj
<< /BG [ 0.75 ] >>
endobj
10 0 obj
<< /Filter /FlateDecode /Type /XObject /Subtype /Form /FormType 1 /BBox [0 0 100 100]
/Resources 11 0 R /Length 170 >>
stream
x }ê1 Ç0 Öw~≈ ahÈ KÈ
q1q0\‚`ú Ÿ¿ 8¯Ôm% u0óª‰.Ô{yπ åP°H-}ª‡à y3 ¸ %≠¡‰ %› g¨$•µMVXø‡Hé†Ö ”î“¿˜® BI•L ˆ†b A pü‰Ã @ÓpB∫ †æœs ãÙ:d8Éwÿr»/}” €∂I÷Bõ B;'+gm Ô˝„ mÙ~ L*>•
endstream
endobj
On closing the PDF document, the assigned value for the push button’s caption is not written to the file and is lost.
Observation 2:
On reopening the PDF document, and assigning a new value for the already-created push button’s caption, a key-value pair for the caption is again correctly added to the PDFAnnotation appearance characteristics dictionary.
On saving/writing to the PDF file, this time, the caption key-value pair in the appearance characteristics dictionary is correctly written/saved to the PDF document file.
Resulting PDF markup:
6 0 obj
<< /Border [ 0 0 0 ] /Rect [ 256 299.8977 356 399.8977 ] /T (button23) /F
4 /BS 8 0 R /Subtype /Widget /DA (/.AppleSystemUIFont 13 Tf 0 g) /MK 9 0 R
/C [ 0 ] /AP 10 0 R /V /Off /M (D:20250330154918Z00'00') /FT /Btn /Type /Annot
/Ff 65536 >>
endobj
10 0 obj
<< /N 11 0 R >>
endobj
9 0 obj
<< /BG [ 0.75 ] /CA (My Button) >>
endobj
8 0 obj
<< /W 0 >>
endobj
11 0 obj
<< /Filter /FlateDecode /Type /XObject /Subtype /Form /FormType 1 /BBox [0 0 100 100]
/Resources 12 0 R /Length 163 >>
stream
x uè1 ¬@ Ö˜˛ä7∂√]ì´◊Î≠ ¡A 8à”a∑Vj·ø˜jë™ !ÅÑ|y/=ˆËA1òʺ]pDá|=0¬“Œb ø+Õ gùf2E≤∞Ê≈N` û·Xm©-BãZ†H Ÿ
¿≈ºPÄ= Ø míãp •¡ ÈÓÅ˙>é “kó· Ÿb#—¬ Ûã¶2∂Ñ2fiÎ ;óDÌiÓ?ü>LÁûÊy;}
endstream
endobj
Impact on User Experience:
Push button captions may not be properly saved to the PDF document’s file. This may result in an application redrawing a push button without a caption/label. More so, an application that uses the caption value to “read” a button’s label (e.g., for accessibility purposes) will not be able to do so.
demo code :
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
// Flip the coordinate system
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
CGContextTranslateCTM(context, 0, self.bounds.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
NSDictionary *attrs = @{NSFontAttributeName: [UIFont systemFontOfSize:20],
NSForegroundColorAttributeName: [UIColor blueColor],
NSUnderlineStyleAttributeName: @(NSUnderlineStyleThick),
};
// Make an attributed string
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:@"Hello CoreText!" attributes:attrs];
CFAttributedStringRef attributedStringRef = (__bridge CFAttributedStringRef)attributedString;
// Simple CoreText with CTFrameDraw
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attributedStringRef);
CGPathRef path = CGPathCreateWithRect(self.bounds,NULL);
CTFrameRef frame = CTFramesetterCreateFrame(framesetter,CFRangeMake(0, 0),path,NULL);
//CTFrameDraw(frame, context);
// You can comment the line 'CTFrameDraw' and use the following lines
// draw with CTLineDraw
CFArrayRef lines = CTFrameGetLines(frame);
CGPoint lineOrigins[CFArrayGetCount(lines)];
CTFrameGetLineOrigins(frame, CFRangeMake(0, 0), lineOrigins);
for (int i = 0; i < CFArrayGetCount(lines); i++) {
CTLineRef line = CFArrayGetValueAtIndex(lines, i);
CGContextSetTextPosition(context, lineOrigins[i].x, lineOrigins[i].y);
// CTLineDraw(line, context);
// You can comment the line 'CTLineDraw' and use the following lines
// draw with CTRunDraw
// use CTRunDraw will lost some attributes like NSUnderlineStyleAttributeName,
// so you need draw it by yourself
CFArrayRef runs = CTLineGetGlyphRuns(line);
for (int j = 0; j < CFArrayGetCount(runs); j++) {
CTRunRef run = CFArrayGetValueAtIndex(runs, j);
CTRunDraw(run, context, CFRangeMake(0, 0));
}
}
}
this code will use CTRunDraw to draw the content , and the underline will draw and show normally in iOS17 & Xcode 15 , But when you build it with XCode16 & iOS18 beta . the underline will be missing .
为什么App 上传testFlight之后。无法通过NFC的方式唤醒 APP Clips。是必须要上架商店之后才能支持么?
My assumption has always been that [NSApp runModalForWindow:] runs a modal window in NSModalPanelRunLoopMode.
However, while -[NSApplication _doModalLoop:peek:] seems to use NSModalPanelRunLoopMode when pulling out the next event to process via nextEventMatchingMask:untilDate:inMode:dequeue:, the current runloop doesn't seem to be running in that mode, so during -[NSApplication(NSEventRouting) sendEvent:] of the modal-specific event, NSRunLoop.currentRunLoop.currentMode returns kCFRunLoopDefaultMode.
From what I can tell, this means that any event processing code that e.g. uses [NSTimer addTimer:forMode:] based on the current mode will register a timer that will not fire until the modal session ends.
Is this a bug? Or if not, is the correct way to run a modal session something like this?
[NSRunLoop.currentRunLoop performInModes:@[NSModalPanelRunLoopMode] block:^{
[NSApp runModalForWindow:window];
}];
[NSRunLoop.currentRunLoop limitDateForMode:NSModalPanelRunLoopMode];
Alternatively, if the mode of the runloop should stay the same, I've seen suggestions to run modal sessions like this:
NSModalSession session = [NSApp beginModalSessionForWindow:theWindow];
for (;;) {
if ([NSApp runModalSession:session] != NSModalResponseContinue)
break;
[NSRunLoop.currentRunLoop limitDateForMode:NSModalPanelRunLoopMode];
}
[NSApp endModalSession:session];
Which would work around the fact that the timer/callbacks were scheduled in the "wrong" mode. But running NSModalPanelRunLoopMode during a modal session seems a bit scary. Won't that potentially break the modality?
I'm trying to accomplish the features in this video where the child device requests permission from parent to control scren time. Then the parent can choose apps on the childs phone from their phone.
Everything on the childs device is working exactly like in the video. However, on the parents phone, when the FamilyActivityPicker appears, it's only the apps on the parents phone and when an app is selected, nothing changes in the FamilyActivitySelection.
I found this forum post describe the same issue I am having. I have a physical device logged in the child and a simulator running as the parent.
Why can't I see the child's apps on the parents phone? Is it cause I'm running one of them on a simulator?
hi anybody have solved issue of MFMailComposeView not work running silicon iosPad app?
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
if ([MFMailComposeViewController canSendMail])
Topic:
UI Frameworks
SubTopic:
General
Lately, when adding a new advanced experience with a new path (with the same domain), it is taking more than a week to get published, when it used to take around 24h. Am I doing something wrong that causes the long delay? Someone else is having this problem? Is something wrong with our assumptions of how it works?
Some assumptions and observations we have around app clip advanced experiences:
Once the app and its appClip are published, new advanced experiences (new paths + cards) don't require a new app review
When adding a new advanced experience, it gets reviewed before being published
There is some bug where even after the experience is published, its status only shows 'Received'
Edits of existing url paths (changing text or image) take less than 24h to propagate
As a workaround we are publishing paths we are still not using with general app clip metadata and then editing when we require them, but this does not allow us to have custom path names for the experiences as we need to 'reserve' them beforehand.