If I have two consecutive calls like to perform(schedule: .immediate) like so: func doSomething() async { await self.perform(schedule: .immediate) { // add log event 1 to data store } await self.perform(schedule: .immediate) { // add log event 2 to data store } } Can I be guaranteed that the block for log event 1 will happen after log event 2? log event here is just an example, so please ignore things like storing date, etc. Looking at the documentation here: https://developer.apple.com/documentation/coredata/nsmanagedobjectcontext/perform(schedule:_:) It's a little unclear whether any such guarantee is in place. However, given that the function returns the value from the block, it seems like I should be able to expect event 1 will always be executed before event 2 regardless of the schedule parameter?
Search results for
SwiftUI List performance
50,598 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello, My app was rejected on iPad (iPad Air 11-inch M3, iPadOS 26.2.1) with two related issues: Guideline 2.1 – Performance – App Completeness “The app exhibited one or more bugs that would negatively impact users. Bug description: the premium subscription cannot be loaded properly.” Guideline 3.1.2 – Business – Payments – Subscriptions “The submission did not include all the required information for apps offering auto-renewable subscriptions.” I am using StoreKit 2 with SubscriptionStoreView to present the auto-renewable subscription. During development: Subscriptions load correctly in the simulator (sandbox). On real devices, I test without a local StoreKit configuration file to fetch products from App Store Connect. The subscription UI (title, duration, price) displays correctly when products are returned. At the time of review, the Paid Apps Agreement was not active. I suspect this may have caused the subscription products to fail loading on the review device. Since then: Paid Apps Agreement is
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit
In-App Purchase
TestFlight
Device: iPhone (real device) iOS: 17.x Permission: Granted Notifications are scheduled using UNCalendarNotificationTrigger. The function runs and prints SCHEDULING STARTED. However, notifications never appear at 8:00 AM, even the next day. Here is my DailyNotifications file code: import Foundation import UserNotifications enum DailyNotifications { // CHANGE THESE TWO FOR TESTING / PRODUCTION // For testing set to a few minutes ahead static let hour: Int = 8 static let minute: Int = 0 // For production use: // static let hour: Int = 9 // static let minute: Int = 0 static let daysToSchedule: Int = 30 private static let idPrefix = daily-thought- private static let categoryId = DAILY_THOUGHT // MARK: - Permission static func requestPermission(completion: @escaping (Bool) -> Void) { let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .sound]) { granted, _ in DispatchQueue.main.async { completion(granted) } } } // MARK: - Schedule static func scheduleNext30Days(isPro: Bo
Hi @MichaelOShea, I've reviewed this thread and your logs. There are two aspects I want to mention: We suggest using the on-device model for simple tasks with a small context window. You can find a list of capabilities (and what to avoid) under Understand model capabilities. If you can pair down your instructions and prompt to a very basic single task that can be described in a sentence or two, then that may be a good candidate for Foundation Models. For large tasks, especially those with multiple steps to process complex information or more than a few paragraphs, it may be better to utilize a server-side frontier model. The system prompt you linked to likely falls into this category. Depending on how your adapter was trained, it may not be tuned for the on-device environment, which is further contributing to why it exceeds the context window. If this is the case then we suggest using the standard SystemLanguageModel and implementing your custom functionality via instructions and prompting instead. W
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
I recently had an app rejected for 2.1 - Performance - App Completeness and specifically, “no subscription options available“. The previous build I submitted did have the issue, but this latest one did not, at least as far as I could test. I tested on two different devices using a sandbox account as well as TestFlight and the IAP were visible and working. I also see each IAP pop up correctly within RevenueCat. One thing that may be an issue is I don’t have the section to attach the IAP onto the build before submitting to review. I’ve read through every help article I could find and have triple-checked everything with the IAP is in order. Pricing, localization, screenshot, review notes, signed agreement, etc. I’ve also tried reaching out several times through the contact us page as well as replied to the review, but haven’t received a response. Is there anything I could be missing? Is not attaching them to the build the issue and if so, how can I get them to show up without recreating the IAP with new
Sorry for the delay in responding to this. Here are a few bug reports that have gotten no attention. All are macOS 26 bugs (the one with iPhone in the title affects macOS and iOS). I have just now gone through to confirm that each are happening consistently on 26.3. Many have been around since 26.0. Several say Recent Similar Reports: More than 10. The last one is a feature suggestion. Thank you for looking into these, especially the first two. FB20794466 -- Item Numbers shown when Overlay is set to None FB21356190 -- Orange microphone appears in menu bar at all times FB20933185 -- Siri voices break System voice UI FB20934473 -- No option to disable Type to Siri ... Siri window does not go away FB20785769 -- Speak announcements only works with Samantha voice FB20813399 -- Keyboard Shortcuts' Restore Defaults button should read Restore Default FB20875408 -- Reverse sort order only available in list view FB20875564 -- Record Selection Menu Bar Icon does not return to default state after Esc is pressed
Topic:
Accessibility & Inclusion
SubTopic:
General
Original Problem We use codesign and notarytool in a scripted environment to build and distribute binaries daily. We also do manual builds by logging into the build server using SSH. This has been working for many years, but after updating to a new Developer ID Application certificate, codesign was failing with errSecInternalComponent and the console logs showed errSecInteractionNotAllowed. Summary of Resolution Attempting to fix the problem resulted in multiple copies of the same Certificate which were NOT shown by Keychain Access. I had to run security delete-identity multiple times to clear out the redundant Identities and then imported the certificate using the security CLI tool. Details I originally followed these instructions for requesting and installing a new certificate: https://developer.apple.com/help/account/certificates/create-developer-id-certificates/ Tip: Use the security tool intead These instructions fail to mention two critical points: 1) they assume the machine you generate the request on
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags:
Signing Certificates
Code Signing
Yes, it makes sense now, so you are letting us know the API: guard let url = URL(string: https://www.apple.com) else { return } if UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url) } else { print(Could not open URL) } Is not working? I can help you with that as there is no bugs on that api at all. I just put the simple app to open and opens safari, but if there is no browser nothing will open? import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundStyle(.tint) Text(Hello, world!) }.task { guard let url = URL(string: https://www.apple.com) else { return } if UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url) } else { print(Could not open URL) } } .padding() } } #Preview { ContentView() } However the API requires an app capable of handling this request as explained here: (Launching the app brings the other app to the foreground.) If no app is capable of handling the specified scheme, the com
Topic:
UI Frameworks
SubTopic:
UIKit
I've seen this behavior as well. Haven't been able to track down exactly why it's happening. I attempted to create a stripped down example, but couldn't recreate the same issue. A couple of things about the ToolbarItemGroup(placement: .keyboard) {} I'm investigating: My implementation is view a SwiftUI View that conforms to the ToolbarContent protocol. My implementation is part of a separate Swift Package utilized in my main project.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Can I make the view layout conditional based on device orientation? For example, responsively switching between HStack and VStack depending on if the device is in Portrait or Landscape mode? Yes you can. In most scenarios you should prefer to make your SwiftUI view layouts conditional based on device orientation. Use AnyLayout to dynamically switch between layout containers based on orientation without destroying the state of your subviews. AnyLayout lets you change layout type at runtime while preserving view identity and state. For example, you can switch between HStackLayout and VStackLayout based on the current size class or orientation, and SwiftUI maintains your view hierarchy seamlessly. For the symbolEffect(_:options:value:) method for SF symbols, the animation only runs when the value changes. Is there a way to implement this behavior idiomatically in SwiftUI? For animations that respond to value changes, use the animation(_:value:) modifier, which applies animations automa
Topic:
UI Frameworks
SubTopic:
SwiftUI
Here’s a recap of the Live Q&A for SwiftUI foundations: Build great apps with SwiftUI. If you participated and asked questions, thank you for coming and participating! If you weren’t able to join us live we hope this recap is useful Where can I watch the VOD? Is the sample code “Wishlist” that was shown available for download? You can view the replay of the entire event here https://www.youtube.com/watch?v=Z3vloOtZLkQ The sample code for the Wishlist app will be made available in the coming weeks on the Apple Developer website, we'll send an update via email when it is available. What are the best practices when it comes to building complex navigations in SwiftUI? The developer website has documentation on navigation style best practices. Explore navigation basics like NavigationStack and TabView to get a ground-up understanding. For documentation on navigation APIs see Navigation. How can I integrate UIKit with my SwiftUI app? What about adding SwiftUI into my
Topic:
UI Frameworks
SubTopic:
SwiftUI
[quote='815475021, krzsiwek, /thread/815475, /profile/krzsiwek'] Is this behavior known and expected? [/quote] Probably [1]. But it’s useful to have a specific benchmark to highlight this cost. I recommend that you file a bug describing the issue, how you’re testing the performance, and what results you got. Please post your bug number, just for the record. [quote='815475021, krzsiwek, /thread/815475, /profile/krzsiwek'] Is there anything we can do to mitigate [this] in our application? [/quote] Not that I can think of. There isn’t really much wiggle room here. Either the property is on or off and, assuming a specific flows hits your packet tunnel provider in both cases, it sees the same set of packets for that flow. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] Historically the networking stack didn’t have fancy features like enforceRoutes, and there’s been decades of optimisation for that simple case.
Topic:
App & System Services
SubTopic:
Networking
I am observing inconsistent pointer hover behavior for a SwiftUI Menu placed inside a ToolbarItem on iPadOS 26.2 (real device). Scenario: • Screen A is pushed inside a NavigationStack. • Screen B is presented as a sheet (with its own NavigationStack). • Both screens contain the same toolbar Menu item using an SF Symbol (arrow.up.arrow.down). Observed behavior: In the pushed view, hover is mostly stable. In the sheet-presented view, the SF Symbol visibly shifts/jumps when pointer hover activates. The hover highlight shape differs from the native navigation back button. Label-level hoverEffect modifiers do not stabilize the behavior. Minimal example: import SwiftUI struct ContentView: View { @State private var showSheet = false var body: some View { NavigationStack { VStack { Button(Open Sheet) { showSheet = true } } .navigationTitle(Home) .toolbar { ToolbarItem(placement: .topBarTrailing) { Menu { Button(Option A) { } Button(Option B) { } } label: { Image(systemName: arrow.up.arrow.down) } }
Topic:
UI Frameworks
SubTopic:
SwiftUI
The Apple sample code Landmarks project uses a LazyVStack inside a ScrollView. For a List, which you want, you will need to: Put the ContainerView in the List as the first row. Set the listRowBackground of the ContainerView to EmptyView(). Set the listStyle to plain, for listRowBackground to work. Add .background(alignment: .top) { with the background you want for the ContainerView. Use readFrame() to dynamically adjust the height of the background to match the maxY position of the ContainerView. import SwiftUI struct ListHeaderScene: View { @State var headerRect: CGRect? var headerHeight: CGFloat { headerRect?.maxY ?? 0 } var body: some View { List { ContainerView() .readFrame { headerRect = $0 } .listRowSeparator(.hidden) .listRowBackground(EmptyView()) Section(Section Title) { Text(Row 1) Text(Row 2) } } .listStyle(.plain) .background(alignment: .top) { // You can swap this for an image or whatever. Color.purple .frame(height: headerHeight) .ignoresSafeArea() } } } struc
Topic:
UI Frameworks
SubTopic:
SwiftUI
Environment: Device: MacBook Pro (Mac16,7) Chip: M4 Pro (SoC ID 6040, Revision 11) OS: macOS 15.2 (24C101) Kernel: Darwin Kernel Version 24.2.0; root:xnu-11215.61.5~2/RELEASE_ARM64_T6041 Summary: I am developing a Windows emulator on the MacBook Pro M4 Pro platform. During testing with certain applications, the system frequently triggers an instantaneous reboot. This issue appears to be highly specific to the M4 Pro hardware and current OS version. Observation & Diagnostic Challenges: Upon reboot, the system generates a bug_type 210 (SoC Watchdog Reset) report. The panic string indicates: Unexpected SoC (system) watchdog reset occurred after panic diagnostics were completed. The primary difficulty in debugging is that the hardware reset happens so rapidly that the kernel fails to capture a stackshot or any detailed panic trace. We have practically no actionable information from the standard diagnostic reports. However, we did find the following recurring entries in the system log prior to the resets: Igno
Topic:
Community
SubTopic:
Apple Developers