iOS is the operating system for iPhone.

Posts under iOS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Deinitializer won't get called
I'm presenting a view controller inside a UIAction handler from the new UIButton init configuration API. But when I do it, its deinit won't get called. I'm thinking there's some sort of retain cycle? I've tried capturing [weak self] inside the closure with no success. Using the addTarget method instead, the deinit gets called as expected. What am I doing wrong? let testVC = TestViewController() lazy var testButton: UIButton = { var configuration = UIButton.Configuration.filled() //button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside) let button = UIButton(configuration: configuration, primaryAction: UIAction(handler: { action in self.present(testVC, animated: true, completion: nil) })) return button }()
1
0
243
1d
VoiceOver Headings Accessibility Rotor with SwiftUI
Hi, I'd like to mark views that are inside a LazyVStack as headers for VoiceOver (make them appear in the headings rotor). In a VStack, you just have add .accessibilityAddTraits(.isHeader) to your header view. However, if your view is in a LazyVStack, that won't work if the view is not visible. As its name implies, LazyVStack is lazy so that makes sense. There is very little information online about system rotors, but it seems you are supposed to use .accessibilityRotor() with the headings system rotor (.accessibilityRotor(.headings)) outside of the LazyVStack. Something like the following. .accessibilityRotor(.headings) { ForEach(entries) { entry in // entry.id must be the same as the id of the SwiftUI view it is about AccessibilityRotorEntry(entry.name, id: entry.id) } } It kinds of work, but only kind of. When using .accessibilityAddTraits(.isHeader) in a VStack, the view is in the headings rotor as soon as you change screen. However, when using .accessibilityRotor(.headings), the headers (headings?) are not in the headings rotor at the time the screen appears. You have to move the accessibility focus inside the screen before your headers show up. I'm a beginner in regards to VoiceOver, so I don't know how a blind user used to VoiceOver would perceive this, but it feels to me that having to move the focus before the headers are in the headings rotor would mean some users would miss them. So my question is: is there a way to have headers inside a LazyVStack (and are not necessarily visible at first) to be in the headings rotor as soon as the screen appears? (be it using .accessibilityRotor(.headings) or anything else) The "SwiftUI Accessibility: Beyond the basics" talk from WWDC 2021 mentions custom rotors, not system rotors, but that should be close enough. It mentions that for accessibilityRotor to work properly it has to be applied on an accessibility container, so just in case I tried to move my .accessibilityRotor(.headings) to multiple places, with and without the accessibilityElement(children: .contain) modifier, but that did not seem to change the behavior (and I could not understand why accessibilityRotor could not automatically make the view it is applied on an accessibility container if needed). Also, a related question: when using .accessibilityRotor(.headings) on a screen, is it fine to mix uses of .accessibilityRotor(.headings) and .accessibilityRotor(.headings)? In a screen with multiple type of contents (something like ScrollView { VStack { MyHeader(); LazyVStack { /* some content */ }; LazyVStack { /* something else */ } } }), having to declare all headers in one place would make code reusability harder. Thanks
1
0
100
1d
Screen Time Bug: iOS 18
Hey, So I obviously downloaded the dev beta the second I could, and I didn’t notice any bugs. Except after the first reboot, the new Screen Time settings UI is replaced by the old one (see video below). This also has an effect on Remote Screen Time Management somehow, making any change (Downtime, App limit, etc) from the guardian’s device over the internet (as in not directly on the managed phone) not take effect at all. Rebooting does nothing, connecting to wifi does nothing, everything. I reported this to the Feedback Assistant so hopefully they catch wind of this soon. Anyone else experiencing this bug or does anyone have a workaround? Reply if so. Thanks, Mr. Sharky
0
1
101
1d
Xcode 15.4 (15F31d) build error: The file “BuildProductsPath” couldn’t be opened because there is no such file.
Hello, When I try to build my project using Xcode 15.4, I get this error: $ xcodebuild BUILD_DIR=/Volumes/C931_SSD/mkl/src/dsym_test/build OBJROOT=/Volumes/C931_SSD/mkl/src/dsym_test/.objs SYMROOT=/Volumes/C931_SSD/mkl/src/dsym_test/.sym -configuration Release -hideShellScriptEnvironment -project /Volumes/C931_SSD/mkl/src/dsym_test/dsym_test.xcodeproj build archive -scheme dsym_test -archivePath /Volumes/C931_SSD/mkl/src/dsym_test/build/dsym_test.ios.xcarchive -sdk iphoneos SKIP_INSTALL=NO Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild BUILD_DIR=/Volumes/C931_SSD/mkl/src/dsym_test/build OBJROOT=/Volumes/C931_SSD/mkl/src/dsym_test/.objs SYMROOT=/Volumes/C931_SSD/mkl/src/dsym_test/.sym -configuration Release -hideShellScriptEnvironment -project /Volumes/C931_SSD/mkl/src/dsym_test/dsym_test.xcodeproj build archive -scheme dsym_test -archivePath /Volumes/C931_SSD/mkl/src/dsym_test/build/dsym_test.ios.xcarchive -sdk iphoneos SKIP_INSTALL=NO User defaults from command line: HideShellScriptEnvironment = YES IDEArchivePathOverride = /Volumes/C931_SSD/mkl/src/dsym_test/build/dsym_test.ios.xcarchive IDEPackageSupportUseBuiltinSCM = YES Build settings from command line: BUILD_DIR = /Volumes/C931_SSD/mkl/src/dsym_test/build OBJROOT = /Volumes/C931_SSD/mkl/src/dsym_test/.objs SDKROOT = iphoneos17.5 SKIP_INSTALL = NO SYMROOT = /Volumes/C931_SSD/mkl/src/dsym_test/.sym ... Touch /Volumes/C931_SSD/mkl/Library/Developer/Xcode/DerivedData/dsym_test-dvvdlvvpbksoxtdglgoqprywugha/Build/Intermediates.noindex/ArchiveIntermediates/dsym_test/InstallationBuildProductsLocation/Library/Frameworks/dsym_test.framework (in target 'dsym_test' from project 'dsym_test') cd /Volumes/C931_SSD/mkl/src/dsym_test /usr/bin/touch -c /Volumes/C931_SSD/mkl/Library/Developer/Xcode/DerivedData/dsym_test-dvvdlvvpbksoxtdglgoqprywugha/Build/Intermediates.noindex/ArchiveIntermediates/dsym_test/InstallationBuildProductsLocation/Library/Frameworks/dsym_test.framework warning: Stale file '/Volumes/C931_SSD/mkl/src/dsym_test/build/Release-iphoneos/dsym_test.framework/Info.plist' is located outside of the allowed root paths. warning: Stale file '/Volumes/C931_SSD/mkl/src/dsym_test/build/Release-iphoneos/dsym_test.framework/dsym_test' is located outside of the allowed root paths. 2024-06-10 17:04:45.163 xcodebuild[30341:2118659] Writing error result bundle to /var/folders/0n/s18rzzz559b9pptn33bs0yz00000gq/T/ResultBundle_2024-10-06_17-04-0045.xcresult xcodebuild: error: The file “BuildProductsPath” couldn’t be opened because there is no such file.: The operation couldn’t be completed. No such file or directory $ The project is called dlsym_test and is an iOS Framework project, language Objective C, containing a single C++ source file named file.cpp. Builds and archives fine, when done via GUI, I get this error, when doing the operation on the command line. :-( The same project builds and archives fine, when I transfer it to an older Mac running Xcode 14.2. Any help would be appreciated. Thanks in Advance, Mario
1
0
104
1d
SwiftData ModelContext Fetch Crashing
I'm currently using Xcode 16 Beta (16A5171c) and I'm getting a crash whenever I attempt to fetch using my ModelContext in my SwiftUI video using the environment I'm getting a crash specifically on iOS 18 simulators. I've opened up a feedback FB13831520 but it's worth noting that I can run the code I'll explain in detail below on iOS 17+ simulator and devices just fine. I'm getting the following crash: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The specified URI is not a valid Core Data URI: x-coredata:///MyApp/XXXXX-XXXXX-XXXX-XXXX-XXXXXXXXXXXX' It's almost as if on iOS18 SwiftData is unable to find the file on the simulator to perform CRUD operations. All I'm doing in my project is simply fetching data using the modelContext. func contains(_ model: MyModel, in context: ModelContext) -> Bool { let objId = palette.persistentModelID let fetchDesc = FetchDescriptor<MyModel>(predicate: #Predicate { $0.persistentModelID == objId }) let itemCount = try? context.fetchCount(fetchDesc) return itemCount != 0 }
2
1
113
1d
TestFlight not working with In-app purchases
Environment react-native-iap: 12.12.2. react-native: 0.72.12. Platforms (physical & simulator): iPhone 11 - OS version 17.4 /// iOS Simulator iPhone 15 Pro Max - OS version 17.4 Description Hello, I am trying to test the purchase of a subscription and an in-app product within my react native app. I have setup the necessary Sandbox account in App Store Connect, created a Store kit file in Xcode that I also synced with the products I created in the App Store Connect dashboard. If I use Xcode to run the app on a physical device (after logging into the sandbox account), I am able to purchase a subscription/in-app product without any issues. If I purchased a subscription on the physical phone I can go into Settings > App Store > Sandbox Account Management and see the purchased subscription, change renewal rate, clear purchase history etc.. If I use the TestFlight build with a physical phone (logging in with the sandbox account) the in app purchases stop working correctly. After purchasing a subscription it is not shown in the Sandbox Account Management, so I am unable to cancel it. Upon trying to purchase another subscription the apple service keeps returning the same exact subscription that I "originally" purchased. How am I supposed to cancel that subscription if it not shown in the sandbox account subscription list? Adding a different sandbox account does not help either, trying to purchase another subscription returns the same subscription that I am unable to cancel. Is there a step in the TestFlight environment that I am missing on setup? Expected Behavior Upon purchasing a subscription in the TestFlight environment on a physical device I should be able to cancel that subscription. Here's an example of what function I am calling on purchasing a subscription: const product = { productId: 'example_monthly_subscription' }; subscribe(product.productId); Any help would be appreciated.
0
0
71
1d
How to exclude RealityKitContent from Swift package for iOS?
I've created an app for visionOS that uses a custom package that includes RealityKitContent as well (as a sub-package). I now want to turn this app into a multi-platform app that also supports iOS. When I try to compile the app for this platform, I get this error message: Building for 'iphoneos', but realitytool only supports [xros, xrsimulator] Thus, I want to exclude the RealityKitContent from my package for iOS, but I don't really know how. The Apple docs are pretty complicated, and ChatGPT did only give me solutions that did not work at all. I also tried to post this on the Swift forum, but no-one could help me there either - so I am trying my luck here. Here is my Package.swift file: // swift-tools-version: 5.10 import PackageDescription let package = Package( name: "Overlays", platforms: [ .iOS(.v17), .visionOS(.v1) ], products: [ .library( name: "Overlays", targets: ["Overlays"]), ], dependencies: [ .package( path: "../BackendServices" ), .package( path: "../MeteorDDP" ), .package( path: "Packages/OverlaysRealityKitContent" ), ], targets: [ .target( name: "Overlays", dependencies: ["BackendServices", "MeteorDDP", "OverlaysRealityKitContent"] ), .testTarget( name: "OverlaysTests", dependencies: ["Overlays"]), ] ) Based on a recommendation in the Swift forum, I also tried this: dependencies: [ ... .package( name: "OverlaysRealityKitContent", path: "Packages/OverlaysRealityKitContent" ), ], targets: [ .target( name: "Overlays", dependencies: [ "BackendServices", "MeteorDDP", .product(name: "OverlaysRealityKitContent", package: "OverlaysRealityKitContent", condition: .when(platforms: [.visionOS])) ] ), ... ] but this won't work either. The problem seems to be that the package is listed under dependencies, which makes the realitytool kick in. Is there a way to avoid this? I definitely need the RealityKitContent package being part of the Overlay package, since the latter depends on the content (on visionOS). And I would not want to split the package up in two parts (one for iOS and one for visionOS), if possible.
1
0
264
2d
Get time it took to complete HMCharacteristic.writeValue()
I'm working on an app that uses HomeKit-enabled accessories such as wall plugs to control a photographic enlarger in a darkroom. This requires precise timing when toggling the power state of the plug. For example, the timer in my app might be set to 5 seconds, so I turn on the plug using writeValue() on the plugs power state characteristic, wait 5 seconds, then turn it off again. I want to be able to measure if the plug actually responded to the command and if there was any delay in the plug actually turning on/off so I can display a warning to the user if network latency resulted in the plug being on for longer than the set time. Does writeValue() (in my case, the async/await version) only return when the plug has been turned on, or does it return as soon as the command has been sent, regardless of if it has been received/acted on? Is there a way I can (a) quickly verify that the plug has been turned on/off, and (b) measure how long it took for the plug to act on the request, that is, the time elapsed between when writeValue() is called and when the plug actually updates to the corresponding value?
0
0
71
2d
Why is `isDepthDataDeliverySupported` returning false on an iPad Pro using `builtInDualWideCamera`?
I am trying to use the AVCamFilter Apple sample project discussed in this WWDC session to get depth data using the dual camera. The project has built-in features to get depth data from the dual camera. When the sample project was written builtInDualWideCamera didn't exist yet, and the project only tries to get builtInDualCamera and builtInWideAngleCamera. When I run the project on my iPad Pro it doesn't show any of the depth-related UI because the device doesn't have a builtInDualCamera device. So I added builtInDualWideCamera in to the videoDeviceDiscoverySession, and it seems to get that device properly, but isDepthDataDeliverySupported is returning false still. Is there some reason why isDepthDataDeliverySupported is false even though I seem to be using a dual camera device? I know the device has a builtInLiDARDepthCamera but I wanted to try out the dual camera depth data to see how it performs for shorter distances. I wouldn't have expected the dual camera depth data delivery to be made unavailable on the device just because the LiDAR sensor is already available. Using iPadOS 17.5.1, iPad Pro 11-inch 4th generation. The depth feature of this sample app works fine on an iPhone 15 I tested. Also tried on an iPhone 15 Pro and it worked even though that device also has a LiDAR sensor, so the issue is presumably not related to the fact that the iPad Pro has a LiDAR sensor.
4
0
156
2d
Xcode 15 does not recognize iPhone 13 Pro Max with iOS 17
Hi! Help me, please. I've installed Xcode 15 on MacOS Ventura 13.5.1 and have an issue, that I couldn't solve in a week: Xcode 15 doesn't recognize iPhone 13 Pro Max with iOS 17 - It doesn't show it at all. What I've found now: Xcode 14.3.1 recognizes the same iphone. Xcode 15 beta has the same issue. Xcode 15 recognizes other devices with 16.4 (iPhone 13 and iPad 8 Gen). Updated the iphone to 17.0.1, same thing. Tried Xcode reinstallation, turning on/off developer mode, unpairing, connecting with other USB cables. Xcode: Version 15.0 (15A240d) iPhone: iPhone 13 Pro Max with iOS 17.0.1 MacOS: Ventura 13.5.1 (22G90) Xcode 14.3.1: Xcode 15 at the same time:
19
9
4.7k
2d
Mimic TV App back button in UIKit
Hi In my application I'm trying to recreate the behaviour of the back button in the Apple TV app on iOS. What I'm looking for is a way to have a material background but also making it possible to animate (with an interruptible animation) the transition when the user scrolls down in a scroll view. When searching around there seems to be 2 hacks which doesn't solve my problem. Either you add a static image for the back button, which doesn't solve any of the points I mentioned before. The other hack is to stop using the back button in the UINavigationBar and start leveraging the left button instead, which I don't want because you loose the swipe back gesture. Can you just pinpoint me what API I could use to get a similar look and feel?
0
0
68
2d
RealityKit on iOS: New anchor entity takes ages to show up
I'm implementing an AR app with Image Tracking capabilities. I noticed that it takes very long for the entities I want to overlay on a detected image to show up in the video feed. When debugging using debugOptions.insert(.showAnchorOrigins), I realized that the image is actually detected very quickly, the anchor origins show up almost immediately. And I can also see that my code reacts with adding new anchors for my ModelEntities there. However, it takes ages for these ModelEntities to actually show up. Only if I move the camera a lot, they will appear after a while. What might be the reason for this behaviour? I also noticed that for the first image target, a huge amount of anchors are being created. They start from the image and go all up towards the user. This does not happen with subsequent (other) image targets.
0
0
87
2d
Tunnel Communication Failures Post-Update
Hello, We are experiencing intermittent tunnel communication failures in iOS devices following internal application updates or fresh installations. This issue occurs specifically with VMware Workspace ONE Advanced (includes AirWatch) - On Premise and Workspace ONE Tunnel. Our enterprise mobility management platform provides comprehensive tools for managing corporate-owned and BYOD devices across various operating systems. Detailed Information: Applications Involved: VMware Workspace ONE Advanced (On-Premise): Manages and secures devices and applications. Workspace ONE Tunnel: Enables per-app VPN services, routing traffic from specific managed applications through our VPN. Problem Context: After a recent update, and notably after introducing deeplinking capabilities which required making our public DNS changes to host the Apple-app-site-association file, iOS devices are not routing application traffic through the Workspace ONE Tunnel correctly. Instead, applications are bypassing VPN configurations and connecting directly to public networks, jeopardizing data security. This behavior is inconsistent and varies across devices. To illustrate, I have attached a diagram (Diagram 1) that shows the flow of traffic during the issue compared to normal operations. Timeline and Troubleshooting Steps Taken: Initial Report Date: February 2024, following the iOS update 17.3.1 and post-deeplinking modifications. VMware Involvement: Multiple troubleshooting sessions, including log analysis and configuration reviews. VMware indicated the issue might not be directly related to their platform as the tunnel functions normally post-device restart. Logs Reviewed: Application logs, network traces, and device management logs. No errors directly linked to VMware solutions were found. The logs showing the issue occurrence and after a device restart are included (see Logs Set A and Logs Set B). Additional Information: Devices Affected: Various iOS devices, total fleet approximately 1500 units. Inconsistencies: The issue manifests inconsistently across different organizational groups (OGs) and is not tied to a specific app version or device model. Developer Notes: The issue does not occur when applications are deployed via Xcode during testing phases. It only arises when apps are updated in a live environment. Request for Assistance: We request Apple’s assistance in investigating potential iOS-specific causes or configurations contributing to this issue, particularly in the context of the deeplinking changes. A joint troubleshooting session is proposed to further diagnose and address the problem. Prompt support in resolving this issue, given its impact on our operations, would be greatly appreciated. Attachments: Diagram 1&2: Traffic Routing During Issue vs. Normal Operation Diagram 3: Our App communications diagram Logs Set A: Device Logs When Issue Occurs Logs Set B: Device Logs After Restart (Set A) After restart - no issue .log https://drive.google.com/file/d/1Q2COgXkMa3KnN1N-ggZKwYhHP7KC-Hwy/view?usp=sharing (Set B) before restart.log https://drive.google.com/file/d/1uS9kAV6zJyRvVRQoWQNKdWBBR7sxM6Js/view?usp=sharing Any suggestions? Thank you!
1
0
58
2d
Triple Click Accessibility Shortcut triggers the Shut Down Screen
The triple click accessibility shortcut is assigned to trigger the assistive touch icon , this works very rarely as intended and triggers the shut down screen. I have tried assigning different shortcuts but it the shut down screen is always triggered. On restarting the phone , it seems to work a few more times as intended , but then again reverts to the bugged state. I have create a feedback (FB13459492) for this in December 2023 but haven't received any reply. Updated recently with a screen recording.
1
0
218
2d