Overview

Post

Replies

Boosts

Views

Activity

SwiftUI onChange fires twice when filtering data from @Observable store
Hi all, I’m running into a “double update” effect in SwiftUI when using the @Observable with @State. I’m trying to understand whether this is expected behavior, a misuse on my side, or a potential bug. Setup I have an observable store using the Observation macro: @Observable class AlbumStore { var albums: [Album] = [ Album(id: "1", title: "Album 1", author: "user1"), Album(id: "2", title: "Album 2", author: "user1"), Album(id: "3", title: "Album 3", author: "user1"), Album(id: "4", title: "Album 4", author: "user1"), Album(id: "5", title: "Album 5", author: "user1"), Album(id: "6", title: "Album 6", author: "user1") ] func addAlbum(_ album: Album) { albums.insert(album, at: 0) } func removeAlbum(_ album: Album) { albums.removeAll(where: { $0 == album }) } } In my view, I inject it via @Environment and also keep some local state: @Environment(AlbumStore.self) var albumStore @State private var albumToAdd: Album? I derive a computed array that depends on both the environment store and local state: private var filteredAlbums: [Album] { let albums = albumStore.albums.filter { album in if let albumToAdd { return album.id != albumToAdd.id } else { return true } } return albums } View usage Inside a horizontal ScrollView / LazyHStack, I observe changes to filteredAlbums: @ViewBuilder private func carousel() -> some View { GeometryReader { proxy in let itemWidth: CGFloat = proxy.size.width / 3 let sideMargin = (proxy.size.width - itemWidth) / 2 ScrollView(.horizontal, showsIndicators: false) { LazyHStack(spacing: 20) { ForEach(filteredAlbums, id: \.id) { album in albumItem(album: album) .frame(width: itemWidth) .scrollTransition(.interactive, axis: .horizontal) { content, phase in content .scaleEffect(phase.isIdentity ? 1.0 : 0.8) } } } .scrollTargetLayout() } .scrollTargetBehavior(.viewAligned(limitBehavior: .always)) .scrollPosition(id: $carouselScrollID, anchor: .center) .contentMargins(.horizontal, sideMargin, for: .scrollContent) .onChange(of: filteredAlbums) { old, new in print("filteredAlbums id: \(new.map { $0.id })") } } } Triggering the update When I add a new album, I do: albumToAdd = newAlbum albumStore.addAlbum(newAlbum) Expected behavior Since filteredAlbums explicitly filters out albumToAdd, I expect the result to remain unchanged. Actual behavior I consistently get two onChange callbacks, in this order: filteredAlbums id: ["E852E42A-AAEC-4360-A6A6-A95752805E2E", "1", "2", "3", "4", "5", "6"] filteredAlbums id: ["1", "2", "3", "4", "5", "6"] This suggests: The AlbumStore update (albums.insert) is observed first. The @State update (albumToAdd) is applied later. As a result, filteredAlbums is recomputed twice with different dependency snapshots. On a real iPad device, this also causes a visible scroll position jump. In the simulator, the jump is not visually observable; however, the onChange(of: filteredAlbums) callback still fires twice with the same sequence of values, indicating that the underlying state update behavior is identical. Strange observations This does not happen with ObservableObject If I replace @Observable with a classic ObservableObject + @Published: class OBAlbumStore: ObservableObject { @Published var albums: [Album] = [ Album(id: "1", title: "Album 1", author: "user1"), Album(id: "2", title: "Album 2", author: "user1"), Album(id: "3", title: "Album 3", author: "user1"), Album(id: "4", title: "Album 4", author: "user1"), Album(id: "5", title: "Album 5", author: "user1"), Album(id: "6", title: "Album 6", author: "user1") ] func addAlbum(_ album: Album) { albums.insert(album, at: 0) } func removeAlbum(_ album: Album) { albums.removeAll(where: { $0 == album }) } } …and inject it with @EnvironmentObject, the double update disappears. Removing GeometryReader also avoids the issue If I remove the surrounding GeometryReader and hardcode sizes: @ViewBuilder private func carousel() -> some View { // GeometryReader { proxy in let itemWidth: CGFloat = 400 let sideMargin: CGFloat = 410 ScrollView(.horizontal, showsIndicators: false) { LazyHStack(spacing: 20) { ForEach(filteredAlbums, id: \.id) { album in albumItem(album: album) .frame(width: itemWidth) .scrollTransition(.interactive, axis: .horizontal) { content, phase in content .scaleEffect(phase.isIdentity ? 1.0 : 0.8) } } } .scrollTargetLayout() } .scrollTargetBehavior(.viewAligned(limitBehavior: .always)) .scrollPosition(id: $carouselScrollID, anchor: .center) .contentMargins(.horizontal, sideMargin, for: .scrollContent) .onChange(of: filteredAlbums) { old, new in print("filteredAlbums id: \(new.map { $0.id })") } // } } …the double onChange no longer occurs. Questions Is this update ordering expected when using @Observable and @State? Does Observation intentionally propagate environment changes before local state updates? Is GeometryReader forcing an additional evaluation pass that exposes this ordering? Is this a known limitation / bug compared to ObservableObject? I want to understand why this behaves differently under Observation. Thanks in advance for any insights 🙏 Full Project Link
2
0
193
4w
Tried to pay for the Developer Program 7 times - still stuck
Hi, I tried to sign up for the Developer Program 7 times, starting on January 5th. It's now been a month. I contacted customer support, they said to try enrolling through the Apple Developer App. I tried that, it asked me to do an identity verification, which I did, successfully. Then the "enroll" button on the app got grayed out and it says: "Enrollment through the Apple Developer app is not available for this Apple Account. Visit http:// developer.apple.com/programs/enroll/." I go to that link, I click "continue with your enrollment", I pay the $99, it goes through, I don't get charged anything, just a $0.00 authorization transaction, then get the "Order Acknowledgment" email, then nothing happens, it just goes nowhere. Please help. If there is anything I can do, or any more information I should supply for this to go through. I contacted support multiple times, but I don't get any response. My enrollment ID is DPTB3R8T2Z.
0
1
163
4w
How do i use dynamic data for my SwiftUI ScrollView without destroying performance?
Currently i am trying really hard to create experience like the Apple fitness app. So the main view is a single day and the user can swipe between days. The week would be displayed in the toolbar and provide a shortcut to scroll to the right day. I had many attempts at solving this and it can work. You can create such an interface with SwiftUI. However, changing the data on every scroll makes limiting view updates hard and additionally the updates are not related to my code directly. Instruments show me long updates, but they belong to SwiftUI and all the advice i found does not apply or help. struct ContentView: View { @State var journey = JourneyPrototype(selection: 0) @State var position: Int? = 0 var body: some View { ScrollView(.horizontal) { LazyHStack(spacing: 0) { ForEach(journey.collection, id: \.self) { index in Listing(index: index) .id(index) } } .scrollTargetLayout() } .scrollTargetBehavior(.paging) .scrollPosition(id: $position) .onChange(of: position) { oldValue, newValue in journey.selection = newValue ?? 0 journey.update() } .onScrollPhaseChange { oldPhase, newPhase in if newPhase == .idle { journey.commit() } } } } struct Listing: View { var index: Int var body: some View { List { Section { Text("Title") .font(.largeTitle) .padding() } Section { Text("\(index)") .font(.largeTitle) .padding() } Section { Text("1 ") Text("2 ") Text("3 ") Text("4 ") Text("5 ") Text("6 ") } } .containerRelativeFrame(.horizontal) } } @Observable class JourneyPrototype { var selection: Int var collection: [Int] var nextUp: [Int]? init(selection: Int) { self.selection = selection self.collection = [selection] Task { self.collection = [-2,-1,0,1,2] } } func update() { self.nextUp = [ self.selection - 2, self.selection - 1, selection, self.selection + 1, self.selection + 2 ] } func commit() { self.collection = self.nextUp ?? self.collection self.nextUp = nil } } #Preview { ContentView() } There are some major Problem with this abstracted prototype ScrollView has no good trigger for the update, because if i update on change of the position, it will update much more than once. Thats why i had to split calculation and applying the diff The LazyHStack is not optimal, because there are only 5 View in the example, but using HStack breaks the scrollPosition Each scroll updates all List, despite changing only 2 numbers in the array. AI recommended to append and remove, which does nothing about the updates. In my actual Code i do this with Identifiable data and the Problem is the same. So the data itself is not the problem? Please consider, this is just the rough prototype to explain the problem, i am aware that an array of Ints is not ideal here, but the problem is the same in Instruments and much shorter to post. Why am i posting this? Scrolling through dynamic data is required for many apps, but there is no proper solution to this online. Github and Blogs are fine with showing a progress indicator and letting the user wait, some probably perform worse than this prototype. Other solutions require UIKit like using a UIPageViewController. But even using this i run in small hitches related to layout. Important consideration, my data for the scrollview is too big to be calculated upfront. 100 years of days that are calculated for my domain logic take too long, so i have no network request, but the need to only act on a smaller window of data. Instruments shows long update for one scroll action tested on a iPhone SE 2nd generation ListRepresentable has 7 updates and takes 17ms LazySubViewPlacements has 2 updates and takes 8ms Other long updates are too verbose to include I would be very grateful for any help.
0
0
66
4w
CRITICAL: Complete TestFlight System Failure - 6 Days, 4 Support Cases, No Solution
I've been experiencing complete TestFlight system failure for 6 days across ALL testing modes with 4 open support cases and zero technical resolution: Support Cases: • 102814191861 (submitted Jan 29) • 102814822980 (submitted Jan 30) • 102814123468 (phone call Feb 3) • 102818476151 (latest update Feb 3) ISSUE DETAILS: App: كيم تحصيلي (ChemTahsili) Bundle ID: com.chemTahsiliApp Build: 1.0.5 (34) SYMPTOMS: ✗ Internal Testing: Users receive "The requested app is not available or does not exist" ✗ External Testing: System shows "Validation Error - Check your entries and try again" ✓ Build Status: Shows "Valid" in App Store Connect ✓ App Status: "Waiting for Review" ✓ All Agreements: Active (Free Apps, Paid Apps, Banking, Tax Forms) ✓ Account Status: Good standing EVIDENCE THIS IS APPLE'S INFRASTRUCTURE ISSUE: Same build fails in BOTH Internal AND External TestFlight Build is marked "Valid" and approved for testing All developer configurations verified correct Issue persists across 6 days and multiple builds No configuration changes can affect External Testing validation SUPPORT RESPONSES SO FAR: "Wait 48 hours and rebuild" (ignoring that app is under App Store review - rebuilding would cancel review) No escalation to TestFlight engineering team No investigation of backend infrastructure Generic troubleshooting that doesn't apply to system-wide TestFlight failure IMPACT: Educational app for chemistry students preparing for critical exams. Hundreds of students affected. Launch delayed 6 days and counting. QUESTION: Has anyone else experienced total TestFlight system failure like this where BOTH Internal and External testing fail for a Valid build? How was it resolved? This is clearly Apple's TestFlight backend problem, not developer misconfiguration. I need engineering-level investigation but support is only providing generic advice. Any help or similar experiences appreciated.
1
1
185
4w
SpringBoard Crashes on macOS Simulator When Receiving Critical Alerts
I’m experiencing a consistent crash of SpringBoard on macOS when running my iOS app in the Simulator. The crash occurs specifically when a critical alert (geofence notification) is triggered by my server and delivered to the app. Xcode version: 16.4 macOS version: 15.5 App uses UNUserNotificationCenter with critical alert notifications related to geofencing. When the critical alert is received, SpringBoard quits unexpectedly on macOS, crashing the Simulator UI to the home screen. The notification is delivered by Firebase, and I have updated to the latest version of that. The console shows: XPC connection interrupted [C:1] Error received: Connection interrupted. [C:1-2] Error received: Connection interrupted. This does not happen when testing on a real device — the app works fine there, however, Springbaord still crashes on macOS. Please advise if this is a known issue or if there’s a workaround. This severely impacts development and testing of location-based critical notifications. The last time I tested this functionality, with an older version of Xcode, I had no issues. Thank you for your help.
3
0
187
4w
Where is the Apple Developer Program and Support I have paid for?
Been trying to get into Developer Prgram since December 2025. And like many others, it seems the biggest tech company on the planet cannot streamline an enrollment program. Unless, it’s by design, to test your nerve? Anyways, I have now ended up paying twice, and still not even a squeak from support. There is no Developer Support phone number in South Africa, and mails go unanswered. How is this possible? $200 out of pocket, and nothing to show. Cannot even find a method for refunds. If there are steps to still follow or docs to submit, why take my money, then ask for more info?? But this black hole of SILENCE…. Now that skype is no longer, what other platform will allow me to call the US Support number from South Africa?
0
0
74
4w
Delete Confirmation Dialog Inside Toolbar IOS26
inline-code How do you achieve this effect in toolbar? Where is the documentation for this? How to make it appear top toolbar or bottom toolbar? Thank you! Here is what I have now... .toolbar { ToolbarItem(placement: .destructiveAction) { Button { showConfirm = true } label: { Image(systemName: "trash") .foregroundColor(.red) } } } .confirmationDialog( "Are you sure?", isPresented: $showConfirm, titleVisibility: .visible ) { Button("Delete Item", role: .destructive) { print("Deleted") } Button("Archive", role: .none) { print("Archived") } Button("Cancel", role: .cancel) { } } }
1
0
207
4w
Orange menu bar icon that won't go away
I have filed bug reports on this to no avail, so I am bringing it up here hoping someone at Apple will address this. Since the first beta of 26.3, with voice control enabled there are now two icons in the menu bar (*plus an orange dot in full screen) that never go away. That orange microphone isn't serving its intended purpose to notify me that something is accessing my microphone if it is always displayed. I use voice control extensively, so it is nearly always on. In every prior version of macOS, the orange icon was not on for voice control. Even if voice control is not listening but simply enabled in system settings, the orange icon will be there. And there is no need for this icon to be on for a system service that is always listening. This orange icon in the menu bar at all times is incredibly irritating, as it takes up valuable space to the right of the notch, and causes other actual useful menu bar items to be hidden. As well, if some other application on my system were to turn on the mic and start recording me I would never know since that orange icon is always on. It also places an orange dot next to the control center icon taking up even more of the precious little menu bar real estate. Please fix this! Either exempt voice control (as Siri is always listening and it doesn't get the orange icon) or exempt all system services, or give me a way to turn this off. If you cannot tell, I find this incredibly annoying and frustrating.
5
0
283
4w
Impossible to Complete Developer Enrollment or Get Support
I started developer enrollment a few weeks ago. My enrollment is stuck. I have received emails from Apple reminding me to upload the documents that were requested but I never got the original email that told me what documents were being requested so I don't know what I'm supposed to upload. I went to the developer.apple.com support page to request a Call Me and when I click the button I get a red error message that says: "There was a problem processing your request." so then I go to Send Us a Message and I receive "This email address isn't valid. To update your email address, visit account.apple.com." and, of course, it IS a valid email address and it is the address I have on file. So, then I called Apple Support and asked if they could, at the very least, put in a Call Me request on my behalf but they said they can't. I have replied to the emails asking me for information but received no response or acknowledgement. The system won't let me request a call and or send a message, Apple support can't even transfer me, I literally have no idea what to do. I need suggestions. Maybe somebody from Apple Developer enrollment will see this message. I can't think of anything else at the moment. Maybe a signal flare? Homing pigeon? Seriously. Help.
1
3
162
4w
Liquid Glass support : Best practices for navigation button styles in iOS 26 and later
Hello! I'm currently working on Liquid Glass support for my app. I understand that starting with iOS 26, standard buttons like "Close" or "Done" have shifted from text buttons to using SF Symbols, as mentioned in the Human Interface Guidelines under "Icons". However, on iOS 18 and earlier, the flat text button style remains the standard. I am unsure about the best approach for backward compatibility: Branch by OS version: Keep text buttons for older OS versions and use SF Symbols for iOS 26+. Concern: This increases the number of conditional branches, potentially reducing code readability and maintainability. Adopt SF Symbols universally: Use SF Symbols for all versions. Concern: I feel that SF Symbols do not fit well (look inconsistent or out of place) with the flat design language of iOS 18 and earlier. What would be the recommended approach in this situation?
Topic: Design SubTopic: General Tags:
5
0
1.5k
4w
Build Failing with Ad-hoc and Developer Distribution Errors
I'm trying to upload my app build with Xcode Cloud. It builds and runs fine on the simulator, but when I try to upload to the cloud it keeps failing from Ad-hoc and Developer Distr. (Error code 70) I have tried/verified: -Verifying that my workflow archive in Xcode is set to "App Store Connect" (setting it to internal Test flight did not work either) -TestFlight Internal is set as a Post-Action and I created/added a test group -All App Store agreements signed and active -Revoking out-of-date developer certificates (Development Managed) -Running build from command line (using git pull origin main, git push origin main) Excerpts of the Error Output (ip addresses censored) Export archive for ad-hoc distribution 15.9s Run command: 'xcodebuild -exportArchive -archivePath /Volumes/workspace/tmp/3fe6638a-94b8-4944-8406-0e291469f933.xcarchive -exportPath /Volumes/workspace/adhocexport -exportOptionsPlist /Volumes/workspace/ci/ad-hoc-exportoptions.plist '-DVTPortalRequest.Endpoint=http://172.16.XX.XX:XXXX' -DVTProvisioningIsManaged=YES -IDEDistributionLogDirectory=/Volumes/workspace/tmp/ad-hoc-export-archive-logs -DVTSkipCertificateValidityCheck=YES -DVTServicesLogLevel=3' Error Command exited with non-zero exit-code: 70 Another similar error exists for development distribution
5
0
427
4w
filecopy fails with errno 34 "Result too large" when copying from NAS
A user of my app reported that when my app copies files from a QNAP NAS to a folder on their Mac, they get the error "Result too large". When copying the same files from the Desktop, it works. I asked them to reproduce the issue with the sample code below and they confirmed that it reproduces. They contacted QNAP for support who in turn contacted me saying that they are not sure they can do anything about it, and asking if Apple can help. Both the app user and QNAP are willing to help, but at this point I'm also unsure how to proceed. Can someone at Apple say anything about this? Is this something QNAP should solve, or is this a bug in macOS? P.S.: I've had users in the past who reported the same issue with other brands, mostly Synology. import Cocoa @main class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { let openPanel = NSOpenPanel() openPanel.canChooseDirectories = true openPanel.runModal() let source = openPanel.urls[0] openPanel.canChooseFiles = false openPanel.runModal() let destination = openPanel.urls[0] do { try copyFile(from: source, to: destination.appendingPathComponent(source.lastPathComponent, isDirectory: false)) } catch { NSAlert(error: error).runModal() } NSApp.terminate(nil) } private func copyFile(from source: URL, to destination: URL) throws { if try source.resourceValues(forKeys: [.isDirectoryKey]).isDirectory == true { try FileManager.default.createDirectory(at: destination, withIntermediateDirectories: false) for source in try FileManager.default.contentsOfDirectory(at: source, includingPropertiesForKeys: nil) { try copyFile(from: source, to: destination.appendingPathComponent(source.lastPathComponent, isDirectory: false)) } } else { try copyRegularFile(from: source, to: destination) } } private func copyRegularFile(from source: URL, to destination: URL) throws { let state = copyfile_state_alloc() defer { copyfile_state_free(state) } var bsize = UInt32(16_777_216) if copyfile_state_set(state, UInt32(COPYFILE_STATE_BSIZE), &bsize) != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } else if copyfile_state_set(state, UInt32(COPYFILE_STATE_STATUS_CB), unsafeBitCast(copyfileCallback, to: UnsafeRawPointer.self)) != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } else if copyfile(source.path, destination.path, state, copyfile_flags_t(COPYFILE_DATA | COPYFILE_SECURITY | COPYFILE_NOFOLLOW | COPYFILE_EXCL | COPYFILE_XATTR)) != 0 { throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno)) } } private let copyfileCallback: copyfile_callback_t = { what, stage, state, src, dst, ctx in if what == COPYFILE_COPY_DATA { if stage == COPYFILE_ERR { return COPYFILE_QUIT } } return COPYFILE_CONTINUE } }
11
0
329
4w
Using a security-scoped bookmark with a symlink
I am developing an application on macOS in SwiftUI which exchanges files with other processes on a network. Some of these processes may be on Linux and write to a network drive. The files are refreshed at 10, 15 or 60 second intervals, and keep the same name. The software is supposed to run 24/7 and have persistent paths, so that on restart it does not need setting up. And it runs in the sandbox. I have got this working with macOS-only external processes by putting the exchange files in a fixed folder on the network storage and using security-scoped bookmarks to the file and or folder. But it doesn't work so well when one of the writing processes is a Linux process writing to its own storage. I can put a symlink in my fixed folder and if i select the folder and the symlink after each app restart, it works. but how can i make such a set-up persistent so it works after app restart without manual selection?
1
0
217
4w
Where is the Apple Developer Program and Support I have paid for?
Been trying to get into Developer Prgram since December 2025. And like many others, it seems the biggest tech company on the planet cannot streamline an enrollment program. Unless, it’s by design, to test your nerve? Anyways, I have now ended up paying twice, and still not even a squeak from support. There is no Developer Support phone number in South Africa, and mails go unanswered. How is this possible? $200 out of pocket, and nothing to show. Cannot even find a method for refunds. If there are steps to still follow or docs to submit, why take my money, then ask for more info?? But this black hole of SILENCE…. Now that skype is no longer, what other platform will allow me to call the US Support number from South Africa?
0
2
75
4w
rm results in "operation not permitted"
I have a file that can not be removed. When I attempt rm -f /Applications/CrashPlan.app I get "Operation not permitted"Here is the scenario, CrashPlan.app was installed on the MacBook Pro (MacBookPro14,2) running 10.14.4. I found out it was an older version of CrashPlan so I downloaded the installer for the new version and ran it. The installed failed and left behind a file of size 0K.-rw-r--r--@ 1 root admin 0 Apr 11 11:43 CrashPlan.appI then tried to remove the 0K file in terminal with sudo rm -f /Applications/CrashPlan.app and that failed with operation not permitted. I then booted into Recovery mode and ran csrutil disable from terminal and rebooted.sudo rm -f /Applications/CrashPlan.app still failed with operation not permitted.I ran csrutil status in terminal to make sure that sip was disabled and got back: System Integrity Protection status: disabled.I tried booting into single user mode and mounted the drive and tried to rm from there and got the same result. So, from single user mode I did the following:mv /Applications /ApplicationsOLDmkdir /Applicationsmv /ApplicationsOLD/* /Applications/and got an error "Operation not permitted" for CrashPlan.apprebooted and was able to install the new version of CrashPlan, but now I have a folder /ApplicationsOLD that I can not get rid of.Any ideas?
6
1
17k
4w
Is it necessary to submit the app for review and complete the review process in order to respond to the age restriction survey?
Or, can we consider the response completes once the prompt disappears? I will write down the sequence of events in order. A prompt appeared on our app's page asking us to respond to the survey. However, likely because the app hadn't been updated for many years, the “Edit” option for age restrictions was not displayed; instead, “View” was shown. After creating a page for the new app version, “Edit” appeared. We hadn't planned to release the new version to the App Store at this time, but we only created the new page to respond to this survey. After entering “edit” and answering the age restriction survey, the prompt disappeared. I contacted Apple Support to find out if just answering would suffice, but they told me to submit the app for review. However, as mentioned above, we have no plans to modify and release this app. Since it's an old app, I updated the environment, built it, and submitted it, but issues were pointed out. (I think it's because it's an old app.) When I asked the Apple Review team the same question as at the beginning, they suggested I post it here. Many thanks!
0
0
154
4w
Apple Dev for 15 years but....
The posts I'm reading here are very discouraging. So many people trying to get into the program, even people that have paid and can't get any support. I've been an Apple developer for 15 years now. I've had various business developer accounts over the years. I've developed in my own name and for customers. This is the first time in a while that I had to get a new business developer account. I applied only a few days ago, so I'm not concerned yet but I don't know why this is so difficult. The posts that I'm reading her here are very discouraging. Why can't we get support on this? Very disappointing. What is happening to Apple? I'd like to get my account, and I'd like all these other people to get some help too. But this form looks completely abandoned.
1
1
124
4w