iOS is the operating system for iPhone.

All subtopics
Posts under iOS topic

Post

Replies

Boosts

Views

Created

Reproducible EXC_BAD_ACCESS in NEDNSProxyProvider when using async/await variants of NEAppProxyUDPFlow
Description I am seeing a consistent crash in a NEDNSProxyProvider on iOS when migrating from completion handlers to the new Swift Concurrency async/await variants of readDatagrams() and writeDatagrams() on NEAppProxyUDPFlow. The crash occurs inside the Swift Concurrency runtime during task resumption. Specifically, it seems the Task attempts to return to the flow’s internal serial executor (NEFlow queue) after a suspension point, but fails if the flow was invalidated or deallocated by the kernel while the task was suspended. Error Signature Thread 4: EXC_BAD_ACCESS (code=1, address=0x28) Thread 4 Queue : NEFlow queue (serial) #0 0x000000018fe919cc in swift::AsyncTask::flagAsAndEnqueueOnExecutor () #9 0x00000001ee25c3b8 in _pthread_wqthread () Steps The crash is highly timing-dependent. To reproduce it reliably: Use an iOS device with Developer Settings enabled. Go to Developer > Network Link Conditioner -> High Latency DNS. Intercept a DNS query and perform a DoH (DNS-over-HTTPS) request using URLSession. The first few network requests should trigger the crash Minimum Working Example (MWE) class DNSProxyProvider: NEDNSProxyProvider { override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool { guard let udpFlow = flow as? NEAppProxyUDPFlow else { return false } Task(priority: .userInitiated) { await handleUDPFlow(udpFlow) } return true } func handleUDPFlow(_ flow: NEAppProxyUDPFlow) async { do { try await flow.open(withLocalFlowEndpoint: nil) while !Task.isCancelled { // Suspension point 1: Waiting for datagrams let (flowData, error) = await flow.readDatagrams() if let error { throw error } guard let flowData, !flowData.isEmpty else { return } var responses: [(Data, Network.NWEndpoint)] = [] for (data, endpoint) in flowData { // Suspension point 2: External DoH resolution let response = try await resolveViaDoH(data) responses.append((response, endpoint)) } // Suspension point 3: Writing back to the flow // Extension will crash here on task resumption try await flow.writeDatagrams(responses) } } catch { flow.closeReadWithError(error) flow.closeWriteWithError(error) } } private func handleFlowData(_ packet: Data, endpoint: Network.NWEndpoint, using parameters: NWParameters) async throws -> Data { let url = URL(string: "https://dns.google/dns-query")! var request = URLRequest(url: url) request.httpMethod = "POST" request.httpBody = packet request.setValue("application/dns-message", forHTTPHeaderField: "Content-Type") let (data, _) = try await URLSession.shared.data(for: request) return data } } Crash Details & Analysis The disassembly at the crash point indicates a null dereference of an internal executor pointer (Voucher context): ldr x20, [TPIDRRO_EL0 + 0x340] ldr x0, [x20, #0x28] // x20 is NULL/0x0 here, resulting in address 0x28 It appears that NEAppProxyUDPFlow’s async methods bind the Task to a specific internal executor. When the kernel reclaims the flow memory, the pointer in x20 becomes invalid. Because the Swift runtime is unaware that the NEFlow queue executor has vanished, it attempts to resume on non-existing flow and then crashes. Checking !Task.isCancelled does not prevent this, as the crash happens during the transition into the task body before the cancellation check can even run. Questions Is this a known issue of the NetworkExtension async bridge? Why does Task.isCancelled not reflect the deallocation of the underlying NEAppProxyFlow? Is the only safe workaround? Please feel free to correct me if I misunderstood anything here. I'll be happy to hear any insights or suggestions :) Thank you!
0
0
52
8h
iOS 26: hidesSharedBackground does not work for backBarButtonItem
What works let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) backButton.hidesSharedBackground = true self.navigationItem.rightBarButtonItem = backButton // or self.navigationItem.leftBarButtonItem = backButton What doesn't work let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) backButton.hidesSharedBackground = true self.navigationItem.backBarButtonItem = backButton I've tried setting this property on all possible permutations and combinations e.g. Inside navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) and pushViewController(_ viewController: UIViewController, animated: Bool) of a custom UINavigationController to make sure. Expected vs Actual behavior Setting hidesSharedBackground = true should remove the glass background from both regular bar button items and back bar button items but it has no effect on backBarButtonItem. Additional context I’m aware of the UIDesignRequiresCompatibility Info.plist key, but I’m looking for a programmatic solution if there is one. The goal is to remove the glass background from back buttons.
0
0
27
2d
Layout issue using .strokeBorder modifier
Hello, Developers! While writing custom view modifier I ran into unexpected behavior of .strokeBorder modifier. The underlying content seem to be “bleeding” outside of the stroke border edges, even though they share the exact same shape for their layout. This issue relevant for both Xcode Previews and on-device testing. Maybe someone has experienced this issue before, I'd be glad to see your opinion on this matter.
1
0
57
3d
UIActivityViewController not vertically scrollable when sharing CSV on specific device (Save option unreachable)
Platform UIKit iOS UIActivityViewController Environment Device (issue reported): iPhone 16 iOS Version: 26.2 App Type: UIKit / Swift (standard modal presentation of UIActivityViewController) Summary When presenting UIActivityViewController to share a CSV file, the share sheet does not allow vertical scrolling, making lower actions (including Save to Files) unreachable. The same flow works correctly when sharing a PDF, and the issue cannot be reproduced on other test devices. Steps to Reproduce Launch the app and log in Navigate to More → Reports Tap Export Report Choose Export Report (CSV) Observe the share sheet Expected Result The user should be able to vertically scroll the share sheet All share actions (including Save to Files) should be reachable Actual Result Share sheet opens but vertical scrolling is disabled Lower options (including Save to Files) are not reachable No crash or console errors
1
0
73
4d
Scheduled events reach threshold almost immediately on iOS 26.2
Hi, we are developing a screen time management app. The app locks the device after it was used for specified amount of time. After updating to iOS 26.2, we noticed a huge issue: the events started to fire (reach the threshold) in the DeviceActivityMonitorExtension prematurely, almost immediately after scheduling. The only solution we've found is to delete the app and reboot the device, but the effect is not lasting long and this does not always help. Before updating to iOS 26, events also used to sometimes fire prematurely, but rescheduling the event often helped. Now the rescheduling happens almost every second and the events keep reaching the threshold prematurely. Can you suggest any workarounds for this issue?
2
0
86
4d
Expected behavior of searchDomains
Based on https://developer.apple.com/documentation/networkextension/nednssettings/searchdomains , we expect the values mentioned in searchDomains to be appended to a single label DNS query. However, we are not seeing this behavior. We have a packetTunnelProvider VPN, where we set searchDomains to a dns suffix (for ex: test.com) and we set matchDomains to applications and suffix (for ex: abc.com and test.com) . When a user tries to access https://myapp , we expect to see a DNS query packet for myapp.test.com . However, this is not happening when matchDomainsNoSearch is set to true. https://developer.apple.com/documentation/networkextension/nednssettings/matchdomainsnosearch When matchDomainsNoSearch is set to false, we see dns queries for myapp.test.com and myapp.abc.com. What is the expected behavior of searchDomains?
6
0
112
5d
Scene-based Launch Detection
Our app supports UIScene. As a result, launchOptions in application(_:didFinishLaunchingWithOptions:) is always nil. However, the documentation mentions that UIApplication.LaunchOptionsKey.location should be present when the app is launched due to a location event. Given that our app is scene-based: How can we reliably determine whether the app was launched due to a location update, geofence, or significant location change? Is there a recommended pattern or API to detect this scenario in a Scene-based app lifecycle? This information is critical for us to correctly initialize location-related logic on launch. Relevant documentation: https://developer.apple.com/documentation/corelocation/cllocationmanager/startmonitoringsignificantlocationchanges()
0
0
51
5d
BLE Advertising in Background
For our research study, it is essential that the app can advertise BLE packets even when the app is no longer in the foreground (for example, when it is in the app switcher / recents state). Is it supported to advertise BLE packets while the app is in the background or recents state? If so, what are the specific requirements or limitations we should be aware of (background modes, payload size, timing, etc.)? Are there any constraints that would prevent consistent BLE advertising for research use cases?
2
0
78
5d
List rows partially obscured by navigation bar briefly render fully opaque when switching tabs (iOS 26)
Overview In iOS 26, a List embedded in a NavigationStack inside a TabView exhibits a visual glitch when switching tabs. When the list is scrolled such that some rows are partially obscured by the navigation bar, the system correctly applies a fade/opacity effect to those rows. However, if the user switches to another tab while rows are in this partially obscured (faded) state, those rows briefly flash at full opacity during the tab transition before disappearing. This flash is visually distracting and appears to be inconsistent with the intended scroll-edge opacity behavior. The issue occurs only for rows partially obscured by the navigation bar. Rows partially obscured by the tab bar do not exhibit this flashing behavior. Steps to Reproduce: Run the attached minimal reproduction on iOS 26. Open the first tab. Scroll the list so that some rows are partially hidden behind the navigation bar (showing the native faded appearance). While rows are in this partially faded state, switch to the second tab. Observe that the faded rows briefly render fully opaque during the tab switch. Expected Behavior: Rows that are partially obscured by the navigation bar should maintain consistent opacity behavior during tab transitions, without flashing to full opacity. import SwiftUI @main struct NavBarReproApp: App { /// Minimal repro for iOS 26: /// - TabView with two tabs /// - First tab: NavigationStack + List /// - Scroll so some rows are partially behind the nav bar (faded) /// - Switch tabs: those partially-faded rows briefly flash fully opaque. Partially faded rows under the tab bar do not flash private let items = Array(0..<200).map { "Row \($0)" } var body: some Scene { WindowGroup { TabView { NavigationStack { List { ForEach(items, id: \.self) { item in Text(item) } } .navigationTitle("One") .navigationBarTitleDisplayMode(.inline) } .tabItem { Label("One", systemImage: "1.circle") } NavigationStack { Text("Second tab") .navigationTitle("Two") .navigationBarTitleDisplayMode(.inline) } .tabItem { Label("Two", systemImage: "2.circle") } } } } }
6
0
127
1w
iOS 26.2 Keyboard shows asymmetric horizontal padding (left edge flush, right padded) in both UIKit & SwiftUI
On iOS 26.01 & 26.2, the system keyboard shows uneven horizontal padding: Leftmost key column touches the screen edge Right side has visible padding This behavior is reproducible: In existing apps In a brand-new demo app In both UIKit and SwiftUI Xcode: 26.0.1 & 26.2 iOS: 26.0.1 & 26.2 Simulator Devices tested: iPhone 15 / iPhone 15 Pro Keyboard types: .numberPad, .decimalPad Frameworks: UIKit, SwiftUI
0
0
84
1w
iOS/iPadOS 26.3 beta 3 and UIFileSharingEnabled regression
FB21772424 On any iPhone or iPad running 26.3 beta 3 with UIFileSharingEnabled enabled via Xcode, a file cannot be manually copied to/from macOS or manually deleted from Finder but 26.3 beta 2 works fine running on any iPhone or iPad. The version of macOS is irrelevant as both macOS 26.2.1 and macOS 26.3 beta 3 are unable to affect file changes via macOS Finder on iPhone or iPad running 26.3 beta 3 but can affect file changes via macOS Finder on iPhone or iPad running 26.2.1 Thank you.
2
0
134
1w
QR code scan deeplink not work in XCode test run?
Hi, I'm trying to figure out what is true here - if I am not in the correct forum please direct me :-) A. It is not possible to test a QR code scan that contains a deeplink into my iOS app from an XCoode build test run. In other words, The build must be published to Test Flight for the iOS's QR code scan sub-system to be able to process the deeplink into my app? If I am wrong about this, it sure would help with testing to be able to test directly from the local XCode build test. If so, can someone point me in the direction of what I would need to do for that? Thanks for your input either way!
0
0
82
1w
iOS 26.2 Safari back button fails to re-open tab with same target
When using iOS 26.2 (23C55) Safari, the following can occur. The current tab (A) opens a new tab (B) via window.open(url, target, windowFeatures). The user clicks the "back" button to close tab B, and returns to tab A. Tab A attempts to open tab B again at a later point, using the same "target" as before, and fails (no window object is returned by window.open). This bug only occurs when the target is the same as the previously closed tab (which was closed via the back button). If a new target is specified, the new tab opens as expected. This bug is also limited to the back button. If the user manually closes tab B, then it can be re-opened by tab A using window.open using the same target as before.
2
0
223
1w
App flagged as duplicate/similar after internal testing on another account
Hello everyone, I’m a developer working for a client company, and I’m trying to publish an iOS app from their Apple Developer account. The app is 100% original and fully developed by me and my team (no templates, no third-party source code reuse, no republished app). During development, I previously uploaded internal test builds of the same project to my personal Apple Developer account for testing purposes, using a different Bundle ID. Now that we are ready to release, we submitted the app from the client's account, and the submission appears to be blocked/rejected due to similarity/duplicate detection (Design Spam: 4.3.0). My questions: What is the recommended Apple process in this situation? Is App Transfer required/expected even if the previous builds on my account were only for internal testing and never publicly released? If App Transfer is not applicable, what is the best way to document that this is the same original app, now being published under the client’s account (authorization/ownership)? Does removing/deleting the test app/builds from my personal account help at all, or is it better to leave history as-is and only provide an explanation to App Review? Any guidance from developers who faced a similar issue (or from Apple engineers) would be really appreciated. Thank you.
2
0
143
1w
Incorrect website rendering under iOS 26.2
Starting with iOS 26.2, when Safari tabs are set to Bottom or Compact view, some pages are not rendering properly. The error does not occur in Top view. For some pages, scrolling causes rendering to be very slow, causing the user to experience page breaks and missing parts. If the user waits a few seconds, the missing parts of the page will appear, but the issue will reoccur when scrolling further. We have tested this on all available iOS devices and the issue occurs on all iPhones running iOS 26.2. The issue does not occur on iOS 26.1, and we have not experienced it on devices running iOS 18. The issue can be reproduced on the following pages with an iPhone running iOS 26.2: https://fotosakademia.hu/products/course/fotografia-kozephaladoknak-haladoknak https://oktatas.kurzusguru.hu/products/course/az-online-kurzuskeszites-alapjai
4
0
472
1w
xcodebuild does not retry UI tests with xcode 26.2
I have ios UI tests that are build with command xcodebuild -workspace ... -scheme ... -configuration ... -derivedDataPath ... -destination ... -testPlan ... build-for-testing Then I run them with xcodebuild -destination ... -resultBundlePath ... -parallel-testing-worker-count ... -xctestrun ... test-without-building I also have following settings in testplan "maximumTestRepetitions" : 3, "testRepetitionMode" : "retryOnFailure", With xcode 16.4 tests were retried on failure up to 3 times, but migrating to xcode 26.2 seems to change this behavior and tests are no longer retried. Is it expected behaviour and I should manually add params like -test-iterations 3 -retry-tests-on-failure into xcodebuild test-without-building command? Here is xcresult - https://drive.google.com/file/d/1xHgiZnIK_lptDSUf-fCyEnT9zYubZlCf/view?usp=sharing And testrun file -https://drive.google.com/file/d/1aBi2sTjy8zFYtgYn1KA60T8gwD_OnBCF/view?usp=sharing
1
0
156
2w
Liquid glass segment view freezes when dragging handle to a disabled segment
Setup: I have a segment view with 3 segments, and the last on (at index 2) is disabled. Issue: When I drag the liquid glass handle of the segment view from what was previously selected to the disabled segment, the liquid glass handle freezes mid-air. Workaround: I can still interact with the handle and manually restore its position, or tap on any other segment to restore its position. Notes: I'm using UIKit, and no extra customizations are applied. class ViewController: UIViewController { @IBOutlet weak var segmentView: UISegmentedControl! override func viewDidLoad() { super.viewDidLoad() segmentView.removeAllSegments() let segments = ["Option 1", "Option 2", "Option 3"] for (index, title) in segments.enumerated() { segmentView.insertSegment(withTitle: title, at: index, animated: false) } // Select the first one by default segmentView.selectedSegmentIndex = 0 // Disable the last segment segmentView.setEnabled(false, forSegmentAt: 2) } }
0
0
71
2w
how to custom DatePicker Label
I have a custom UI to display date (for user birthday) and want if the user presses each part of the label , the date selection is displayed, the current issue is , when I try to reduce the DatePicker opacity or set the colorMultipli to clear color, it still clickable on the date area, while my object is a fullWidth object, how can I fix it? This is the code: VStack(alignment: .leading, spacing: 8) { Text("Birthday") .font(.SFProText.font(type: .medium, size: 13)) .foregroundStyle(Color(uiColor: .label)) HStack(alignment: .center) { Text(userProfileAccountInfoviewModel.birthday.getShortFormat(format: "dd MMM yyyy")) .font(.SFProText.font(type: .medium, size: 13)) .foregroundColor(Color(uiColor: .label)) .padding(.horizontal, 13) Spacer() } .frame(height: 44) .contentShape(Rectangle()) .overlay { HStack { DatePicker(selection: $userProfileAccountInfoviewModel.birthday, displayedComponents: .date) {} .labelsHidden() .colorMultiply(.clear) .background(Color.clear) .foregroundStyle(Color.baseBackgroundSecondary) .frame(maxWidth: .infinity) .contentShape(Rectangle()) // .opacity(0.011) Spacer() } } .background(Color.baseBackgroundSecondary) .clipShape(RoundedRectangle(cornerRadius: 4)) }
1
0
268
2w
Simulator is not working.
Hi, I am a UI designer and a total newbie with coding, so I have been using AI in Xcode to do all my coding for my personal project. Everything was working fine until this morning, when I tried to run my app in the simulator (I didn't even change any code from the last time I ran the simulator) and now the simulator is crashing and freezing and I have been trying to fix it with the AI recommendations, but it seems way too complicated for me to handle even with AI's help. I feel like I need to talk to an expert and guide me out of this hole. Please help. Thank you!
3
0
355
2w