iOS is the operating system for iPhone.

iOS Documentation

Posts under iOS tag

2,673 Posts
Sort by:
Post not yet marked as solved
0 Replies
9 Views
My iOS app wants to associate itself with a certain file extension, let's say .aaa. To do so I declare the following exported type: <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> </array> <key>UTTypeDescription</key> <string>AAA File</string> <key>UTTypeIdentifier</key> <string>com.myapp.aaa</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>aaa</string> </array> </dict> </dict> As well as this under the supported document types: <dict> <key>CFBundleTypeExtensions</key> <array> <string>aaa</string> </array> <key>CFBundleTypeName</key> <string>AAA File</string> <key>LSItemContentTypes</key> <array> <string>com.myapp.aaa</string> </array> <key>LSHandlerRank</key> <string>Owner</string> </dict> Turns out, several other apps on the App Store also register the .aaa file extension, each under a different UTI, making it impossible to open .aaa in my app if they installed it after already having installed another app claiming this extension. Moreover, some of these app declare all of their supported file extensions under a single UTI (e.g. both .aaa and .bbb are associated with the com.theirapp.generic UTI), so I can't even add their UTI to LSItemContentTypes without associating myself with files I don't support. How do I force iOS to allow opening every file with the .aaa extension with my app, regardless of any potential third-party app registering the same extension? For clarification – the .aaa file extension in this example is always associate with a single type and format, but it doesn't have an agreed-on UTI identifier or MimeType, nor is there a single app that should be the sole "exporter" of the UTI type.
Posted
by LIJI32.
Last updated
.
Post not yet marked as solved
0 Replies
37 Views
I am exploring on managing state in SwiftUI app with purpose built Views due to the advantages for managing dependency with Environment. This is the minimal example I came up with: @MainActor struct AsyncStateModifier<T: Equatable>: View { let input: T let action: (T) async -> Void @Environment var queue: AsyncActionQueue var body: some View { return EmptyView() .onChange(of: input, initial: true) { old, new in queue.process(action: action, with: input) } } } The drawback of this approach is initial: true allows the onChange callback to fire when view appears and since EmptyView doesn't appear the action is never executed initially. When replacing EmptyView with Rectangle().hidden() this can be achieved, but I wanted to avoid having any impact on view hierarchy and EmptyView is suitable for that. Is there any alternative approach to make something like this possible?
Posted Last updated
.
Post not yet marked as solved
0 Replies
44 Views
We are trying to diagnose an issue with our VPN network extension but have discovered that the VPN logging profile, available on the Apple Developer website is not valid: We have tried installing it on multiple phones, including the latest version of iOS 17 with no success so far. We would appreciate if the profile could be updated as soon as possible.
Posted Last updated
.
Post not yet marked as solved
0 Replies
55 Views
This is crash stack. What caused this crash? How to solve it? Date/Time: 2024-05-17 11:12:48.0370 +0800 Launch Time: 2024-05-17 11:12:28.4598 +0800 OS Version: iPhone OS 17.4.1 (21E236) Release Type: User Baseband Version: 3.50.04 Report Version: 104 Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001aee09920 Triggered by Thread: 0 Kernel Triage: VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter Thread 0 Crashed: 0 libdispatch.dylib 0x00000001aee09920 _dispatch_lane_resume + 712 (queue.c:3284) 1 CoreFoundation 0x00000001a6f357a8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 (CFNotificationCenter.c:700) 2 CoreFoundation 0x00000001a6f35170 ___CFXRegistrationPost_block_invoke + 88 (CFNotificationCenter.c:193) 3 CoreFoundation 0x00000001a6f350b8 _CFXRegistrationPost + 440 (CFNotificationCenter.c:221) 4 CoreFoundation 0x00000001a6f34608 _CFXNotificationPost + 728 (CFNotificationCenter.c:1247) 5 Foundation 0x00000001a5dc6f10 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (NSNotification.m:531) 6 UIKitCore 0x00000001a930f04c -[UIApplication _sendWillEnterForegroundCallbacks] + 212 (UIApplication.m:11709) 7 UIKitCore 0x00000001a930d7cc __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke_2 + 1272 (_UISceneLifecycleMultiplexer.m:653) 8 UIKitCore 0x00000001a930d298 _UIScenePerformActionsWithLifecycleActionMask + 112 (_UISceneLifecycleState.m:109) 9 UIKitCore 0x00000001a9393934 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 216 (_UISceneLifecycleMultiplexer.m:566) 10 UIKitCore 0x00000001a92bcac4 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 220 (_UISceneLifecycleMultiplexer.m:515) 11 UIKitCore 0x00000001a92bb53c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 608 (_UISceneLifecycleMultiplexer.m:565) 12 UIKitCore 0x00000001a92baea4 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 248 (_UISceneLifecycleMultiplexer.m:468) 13 UIKitCore 0x00000001a92bad74 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block... + 148 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:73) 14 UIKitCore 0x00000001a92bac7c +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 (BSAnimationSettings+UIKit.m:54) 15 UIKitCore 0x00000001a92ba504 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 (_UISceneSettingsDiffAction.m:27) 16 UIKitCore 0x00000001a92ba1b4 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:58) 17 UIKitCore 0x00000001a964ae20 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.226 + 612 (UIScene.m:2067) 18 UIKitCore 0x00000001a92b9328 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 (UIScene.m:1736) 19 UIKitCore 0x00000001a92b9198 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 (UIScene.m:2026) 20 UIKitCore 0x00000001a92b8fd8 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 (UIApplicationSceneClientAgent.m:86) 21 FrontBoardServices 0x00000001bfaeb524 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 660 (FBSScene.m:812) 22 FrontBoardServices 0x00000001bfaeb270 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152 (FBSWorkspaceScenesClient.m:692) 23 FrontBoardServices 0x00000001bfaeb10c -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 (FBSWorkspace.m:411) 24 FrontBoardServices 0x00000001bfaeb028 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 344 (FBSWorkspaceScenesClient.m:691) 25 libdispatch.dylib 0x00000001aee02dd4 _dispatch_client_callout + 20 (object.m:576) 26 libdispatch.dylib 0x00000001aee0686c _dispatch_block_invoke_direct + 288 (queue.c:511) 27 FrontBoardServices 0x00000001bfae7490 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:285) 28 FrontBoardServices 0x00000001bfae7410 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 (FBSSerialQueue.m:309) 29 FrontBoardServices 0x00000001bfae72e8 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:322) 30 CoreFoundation 0x00000001a6f3d62c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957) 31 CoreFoundation 0x00000001a6f3c8a8 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001) 32 CoreFoundation 0x00000001a6f3b058 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038) 33 CoreFoundation 0x00000001a6f39d88 __CFRunLoopRun + 828 (CFRunLoop.c:2955) 34 CoreFoundation 0x00000001a6f39968 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420) 35 GraphicsServices 0x00000001eb22f4e0 GSEventRunModal + 164 (GSEvent.c:2196) 36 UIKitCore 0x00000001a93acedc -[UIApplication _run] + 888 (UIApplication.m:3692) 37 UIKitCore 0x00000001a93ac518 UIApplicationMain + 340 (UIApplication.m:5282) 38 VRCapture 0x00000001045ac3a4 main + 84 (main.m:33) 39 dyld 0x00000001ca45ad84 start + 2240 (dyldMain.cpp:1298)
Posted
by jtyan.
Last updated
.
Post not yet marked as solved
1 Replies
108 Views
Hello, We're developing a framework that needs to talk to a camera on iOS. We've written a Driverkit Extension to enable this but we're having trouble working out how to distribute this to third parties. We have to specify the application's bundle id in the driverkit's bundle ID. But as far as I can tell that means if there are multiple consumers, they each need their own specially built driverkit extension. For MacOS, we can see an entitlement that allow any 'user client' to connect to our driverkit extension. But from what I can tell, that doesn't seem to be the same for iOS. Am I missing something? Or is it expected that we should have to build a new driverkit extension with a different bundle ID for every app that every third party wants to develop? Let me know if I'm missing too much context, thanks in advance!
Posted Last updated
.
Post not yet marked as solved
0 Replies
31 Views
Hello everyone, I am developing a feature in my app where, upon receiving a push notification, the app should open automatically if it is closed and the screen is locked. If the device is unlocked, a persistent notification should appear and only be removed with user interaction. We managed to implement this functionality on Android using some configurations and additional rules. With this, upon receiving a push notification, the app opens automatically or a permanent notification appears. I would like to know how I can implement this functionality on iOS using Swift. Is there any specific configuration or API that allows the app to open automatically upon receiving a push notification or to display a persistent notification on the unlocked screen? Thanks in advance for your help!
Posted
by andrerds.
Last updated
.
Post not yet marked as solved
3 Replies
346 Views
I have created a custom input field by conforming to UITextInput. It is setup to use UITextInteraction. Everything works very well. If the user taps on the custom field, the cursor (provided by UITextInteraction) appears. The user can type, select, move the cursor, etc. But I'm stumped trying to get the cursor to appear automatically. With a normal UITextField or UITextView you simply call becomeFirstResponder(). But doing that with my custom UITextInput does not result in the cursor appearing. It only appears if the user taps on the custom field. I don't know what I'm missing. I don't see any API in UITextInteraction that can be called to say "activate the cursor layer". Does anyone know what steps are required with a custom UITextInput using UITextInteraction to activate the cursor programmatically without the user needing to tap on the custom field?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
6 Replies
595 Views
I'm new to Networking, so forgive me if this is a silly question: In the sample code, Building a custom peer-to-peer protocol, TLS is configured as follows: // Create TLS options using a passcode to derive a pre-shared key. private static func tlsOptions(passcode: String) -> NWProtocolTLS.Options { let tlsOptions = NWProtocolTLS.Options() let authenticationKey = SymmetricKey(data: passcode.data(using: .utf8)!) var authenticationCode = HMAC<SHA256>.authenticationCode(for: "TicTacToe".data(using: .utf8)!, using: authenticationKey) let authenticationDispatchData = withUnsafeBytes(of: &authenticationCode) { (ptr: UnsafeRawBufferPointer) in DispatchData(bytes: ptr) } sec_protocol_options_add_pre_shared_key(tlsOptions.securityProtocolOptions, authenticationDispatchData as __DispatchData, stringToDispatchData("TicTacToe")! as __DispatchData) sec_protocol_options_append_tls_ciphersuite(tlsOptions.securityProtocolOptions, tls_ciphersuite_t(rawValue: TLS_PSK_WITH_AES_128_GCM_SHA256)!) return tlsOptions } The sample code touts the connection as secure ("...uses Bonjour and TLS to establish secure connections between nearby devices"), but to my untrained eye it doesn't seem so. My reasoning is as follows: If I adapt this code as-is, so connections between two instances of my app use SymmetricKeys derived from the four-digit passcode, then wouldn't my encryption be easy to break by an adversary who sends 0000...9999 and records corresponding changes in the encryption, exposing my app to all sorts of attacks? The sample uses the passcode to validate the connection (host user shows client user the passcode, which is manually entered), which is a feature I would like to keep in some form or another, which is why this is causing so many headaches. Generally speaking, is there a way to secure a local peer-to-peer connection over Network.framework that doesn't involve certificates? If certificates are the only way, are there good resources you can recommend?
Posted
by wmk.
Last updated
.
Post not yet marked as solved
3 Replies
676 Views
I recently encountered a difficult-to-diagnose bug in an app that I'm working on, and I thought I would share it with the Apple Developer community. The app that I'm working on is an iOS app that uses Core Location's Visit Monitoring API, and it is essential that the app is able to process incoming visits while running in the background. However, after real-world testing, I discovered several crash reports which were difficult to understand, as SwiftUI symbols are not symbolicated on debug builds. Eventually I discovered that the app was crashing when calling an @EnvironmentObject property of the root ContentView from that view's body when the app was launched directly into the background from not running at all. After creating a small test app to isolate the problem, I discovered that any environment object declared in the App struct and referenced from the root ContentView causes the crash, with the exception message: "Fatal error: No ObservableObject of type ArbitraryEnvObject found. A View.environmentObject(_:) for ArbitraryEnvObject may be missing as an ancestor of this view." It seems that when a SwiftUI app is launched in the background, the ContentView's body is executed, but the environment is not initialized. I searched through as much documentation as I could, but could not find any information about how this should be handled, so I think it's a bug in SwiftUI. I have filed a Feedback Assistant bug report. The current workaround is to convert my ObservableObject into an object that conforms to the new @Observable protocol, add it to the scene as an Environment Value with the .environment(_:) modifier rather than the .environmentObject(_:) modifier, and declare the @Environment property on the view as optional. The object will still be missing when the app is launched in the background, but the optional property can be handled safely to prevent a crash. Attached to this post is a sample project that demonstrates the issue and the workaround. And finally, I'd like to hear from anyone who knows more about the expected behavior of background launches of SwiftUI apps, and whether or not there's something I should be doing completely differently. I'm not able to directly attach a zip archive to this post, so here's an iCloud link to the sample project: BackgroundEnvObjCrash.zip
Posted Last updated
.
Post not yet marked as solved
0 Replies
109 Views
I'm experiencing an issue with WKWebView and localStorage. I've set up a standard WKWebView with the configuration: configuration.websiteDataStore = WKWebsiteDataStore.default() Everything works fine in the emulator (iOS 16.x, 17.0), but on my iPhone 13 running iOS 17.4, I encounter a problem. When I set a localStorage value on my local HTML page, navigate to another URL within the webview, and then return to the original page, the localStorage is cleared. This behavior is new and wasn't happening before. Has anyone else encountered this or have any suggestions on how to fix it? The localstorage should be persistent as it always has been.
Posted
by AvadheshB.
Last updated
.
Post not yet marked as solved
6 Replies
797 Views
Hi, With iOS-17.4 update, we are seeing AppProxy VPN not getting started when Apps (associated with PerAppVPN) tried to access network resource after MDM PerAppVPN profile install/update. Looks like PerApp rules associated with applayer vpn profile are broken after profile update/install as we see internet sites working without going through VPN (appProxy network extension), this start working if we toggle WiFi and then access network resource from Apps associated with PerAppVPN. Created FB13688086 with all the details for this iOS 17.4 and AppLayerVPN, looking for and update here and any feedback/pointers will help. Thanks
Posted
by vmku.
Last updated
.
Post not yet marked as solved
0 Replies
79 Views
We are considering raising the age rating of our existing app. Currently, the app is rated 4+, but we are looking into raising it to 12+. We have some questions regarding this change and would appreciate your guidance: For users under 12 years old (below the specified age) who have already installed the app: Will they still be able to use the app as before? Will they be unable to receive updates? For users under 12 years old (below the specified age) accessing the App Store: How will the app appear to them? Will it become invisible in the App Store for them? Thank you for your assistance.
Posted
by Negan_tt.
Last updated
.
Post not yet marked as solved
1 Replies
416 Views
I've been asked to replace Flurry Analytics with Apple's Analytics Framework. I'm referring to runtime reporting of activity within the app itself... ie log event when various views are loaded or when certain buttons are pressed etc. All these log events are then uploaded and available for viewing by the app developer. I've never used or even heard of such a framework from Apple. I see a lot about Apple Analytics as an Appstoreconnect api for gathering sales and marketing data but nothing about the type of analytics i'm looking for. Any information about what is (or is not) available from Apple would be greatly appreciated. Thanks
Posted
by tpmeehan.
Last updated
.
Post not yet marked as solved
0 Replies
84 Views
Hi, When I uploaded 2 videos in the Event Card Video, and Event Details Page Video section of a new In-App Event, both are showing processing for a long time. I'm trying to upload videos for the first time in an in-app event, is it normal to take longer time on video processing? The video dimension is 1920x1080 with 30fps for the event card video, and 1080x1920 with 30fps for the event details page video. Please let me know if you have any tips.
Posted
by sivareena.
Last updated
.
Post not yet marked as solved
1 Replies
121 Views
I have recently submitted a new app version to the Appstore with Xcode 15.0. Unfortunately, I have started to see the below crash in the Xcode organiser &gt; Crashes section occurring for more number of times. UIKitCore: +[UIAlertController _alertControllerContainedInViewController:] + 160 The exception trace is not leading to main() function but not pointing to any of the code line. I had used UIAlertController in the past versions to show the alerts but there is no code written in the current version code related to UIAlertController. Only from the latest version, this kind of crash started to surface. In the latest release, We have added a third party SDK and while implementing the SDK, we had added the Location and Bluetooth Permissions in Info.plist file. But as we don't want to use/track the Location and Bluetooth details from the app, the SDK team has disabled the Location and Bluetooth settings to not reflect in the tracked data. Is this behaviour creating any conflict with the UIAlertController and logging the crash? Because by default the OS tries to show the alert when the permissions exist in the plist file, but the alert will not come as the service is disabled on the SDK server settings. Is this creating any conflict and logging the crash. Please extend your help.
Posted Last updated
.
Post not yet marked as solved
0 Replies
126 Views
Hello, I'm currently integrating a feature in our app that allows customers to set up a passkey. Once set up, users are prompted to use their passkey at the sign-in page. For users without a registered passkey, we ensure that the passkey assertion request fails silently to maintain a smooth login experience, using preferImmediatelyAvailableCredentials effectively for this purpose. However, we've noticed that when users are employing third-party password managers like 1Password or Bitwarden, they encounter a QR code fallback. Discussions with 1Password have revealed that iOS does not currently extend preferImmediatelyAvailableCredentials to these services. I would appreciate any advice on how to harmonize the behavior between iCloud Keychain and third-party password providers to ensure a consistent user experience.
Posted Last updated
.
Post not yet marked as solved
0 Replies
94 Views
Hello, I'm facing an issue with the volume slider in AVPlayer. Despite setting the volume property and mute property to false, the volume slider does not work as expected. Initially, the volume is muted with the slider set to the minimum. If I change the volume, when I release the slider, it returns to the minimum and the mute icon remains active. However, if I set it to maximum, the setting remains and the icon changes. However, the video volume never changes and remains at the value set in the code. Here is the code I am using: var player: AVPlayer! var playerController: AVPlayerViewController! override func viewDidLoad() { super.viewDidLoad() player = AVPlayer(url: URL(fileURLWithPath: Bundle.main.path(forResource: "video", ofType: "mp4")!)) player.volume = 0.5 player.isMuted = false playerController = AVPlayerViewController() playerController.player = player playerController.view.frame = self.view.frame addChild(playerController) view.addSubview(playerController.view) playerController.view.frame = view.bounds playerController.didMove(toParent: self) player.play() } Can someone please help me resolve this issue? Any assistance would be greatly appreciated. Thank you.
Posted
by Luck81.
Last updated
.
Post marked as solved
1 Replies
129 Views
When I run my app in debug mode, whenever a time consuming task is run (like a core data fetch request) there is a time indication appearing on top of the view. I am unable to find the meaning of this and how it is named. It looks like: "appName NNNN ms" (it is not caught by the screen shot) Can someone tell if it is possible to get rid of it and how ? Thanks for your help !
Posted
by SimonWin.
Last updated
.
Post marked as solved
1 Replies
133 Views
Starting on Xcode 15.3 and 15.4 my SwiftUI Previews stopped working with the following error: == PREVIEW UPDATE ERROR:     LinkDylibError: Failed to build ContentView.swift          Linking failed: linker command failed with exit code 1 (use -v to see invocation)          ld: warning: search path '/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator' not found     Undefined symbols for architecture arm64:       "static MyLibrary.DisplayUtil.getText() -> Swift.String", referenced from:           closure #1 () -> SwiftUI.Text in (extension in Demo_Broken_Preview_PreviewReplacement_ContentView_1):Demo_Broken_Preview.ContentView.(__preview__body in _1BA320C8FB5388C953E1E463345C3D72).getter : some in ContentView.1.preview-thunk.o       "type metadata accessor for MyLibrary.DisplayUtil", referenced from:           closure #1 () -> SwiftUI.Text in (extension in Demo_Broken_Preview_PreviewReplacement_ContentView_1):Demo_Broken_Preview.ContentView.(__preview__body in _1BA320C8FB5388C953E1E463345C3D72).getter : some in ContentView.1.preview-thunk.o     ld: symbol(s) not found for architecture arm64     clang: error: linker command failed with exit code 1 (use -v to see invocation) After much trial and error, I narrowed it down to my SwiftUI views using properties or functions inside components in Swift Packages. This is a simple example of my Swift Package: public class DisplayUtil {     public func getText() -> String {         return "Text"     }          public static func getText() -> String {         return "Text"     } } And my SwiftUI View import SwiftUI import MyLibrary struct ContentView: View {     var body: some View {         VStack {             Text(DisplayUtil.getText())         }         .padding()     } } #Preview {     ContentView() } The same code works fine on Xcode 15.2 Link to the sample project: https://www.icloud.com/iclouddrive/0c00AD0esi2PwqqiRggokfwGw#Demo%5FBroken%5FPreview Is anybody else having a similar issue?
Posted
by xlsmearlx.
Last updated
.