Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

SwiftUI view state resetting after alert is shown
Seeing an issue in iOS 26.2 iPhone 17 simulator (haven't been able to reproduce on device or other simulators), where a view's state is reset after an alert is shown. In this example the first LibraryView has the issue when alert is shown, the second LibraryView maintains state as expected. struct ContentView: View { var body: some View { NavigationStack { List { VStack { LibraryView(title: Show view (Loss of state)) } LibraryView(title: Show view (Works as expected)) } } } } /// This view is from a package dependency and wants to control the presentation of the sheet internally public struct LibraryView: View { @State private var isPresented: Bool = false let title: String public init(title: String) { self.title = title } public var body: some View { Button(self.title) { self.isPresented = true } .sheet(isPresented: self.$isPresented) { ViewWithAlert() } } } private struct ViewWithAlert: View { @State private var isPresented: Bool = false @State private var presentedCount = 0 var body: some View { B
Topic: UI Frameworks SubTopic: SwiftUI
11
0
405
Jan ’26
How to Center an App Icon Image Vertically in a UITableViewCell
Hello! I'm making a list of app icons for users to choose, but when I increase or decrease the font size, the image is still in the same spot and isn't centered vertically with the text. I have it initialized with a frame with hard-coded values, but I was wondering if there was a better way of doing it, such as with constraints or some sort of image scaling. I've provided code blocks and an image of what is happening. ImageView Configuration // App Icon Image UIImageView *appIconImageView = [[UIImageView alloc] initWithFrame: CGRectMake(12.5, 17, 22.5, 22.5)]; // Configurations UIImageSymbolConfiguration *multicolorConfiguration = [UIImageSymbolConfiguration configurationPreferringMulticolor]; UIImageSymbolConfiguration *sizeConfiguration = [UIImageSymbolConfiguration configurationWithScale: UIImageSymbolScaleSmall]; UIImageSymbolConfiguration *appIconConfiguration = [multicolorConfiguration configurationByApplyingConfiguration: sizeConfiguration]; appIconImageView.preferredSymbolConfiguration = appI
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
367
Jan ’26
Reply to State loss and sheets dismiss on backgrounding app
Thanks for the post, this is very interesting. And thanks for the bug where includes the focused project sample. Navigating complex hierarchies in SwiftUI while maintaining state can indeed be challenging. I can try to suggest some potential workarounds and strategies to mitigate state loss issues during navigation and app backgrounding but I also want to see this issue and use your focus sample to see how the sheets are lost after being presented on the app and to see if moving state management to a parent view is the answer and understand how the views are not being shown after the background. Passing state down through view hierarchies can ensure it's retained longer than if it were localized in deeply nested views. If you're not already on the latest SwiftUI and iOS version, consider updating to see if the issue has been addressed in more recent releases. Additionally, beta versions can sometimes provide pre-release fixes. You can see the status of your feedback in Feedback Assistant. Th
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
Reply to Entitlement for extension to have read-only access to host's task?
Thanks for the extra context. At this point I feel comfortable talking about technical stuff… Oh wait, there’s one more business-y thing. My focus is on technical stuff. I don’t work for App Review and can’t make definitive statements about their policies. OK, now let’s talk technical… Mach is a capability-based system [1]. For you to get access to a Mach port, someone who already has access must share their access with you. So, who has access? And how can you convince them to share? In this case only two entities have access: The ‘system’ The target process itself There’s no way to convince the system to share its access, at least on iOS [2]. So the only option is to get the target process to give you access to itself. In theory, this should be trivial: Your app calls mach_task_self to get a send right for its control port. It then sends your extension a copy of that right via XPC. In practice, there are complications. IMPORTANT I’ve never tried this sort of thing on iOS, so I’ve no idea whether it’ll work a
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
ITMS-91065: Missing signature and forks of open source libs
Hello, I received an App Store rejection (ITMS-91065: Missing signature) for one of my iOS apps related to vendor-signed third-party SDKs and I want to understand the rule more clearly. My understanding is that some third-party SDKs must be vendor-signed; I believe the vendor list is: https://developer.apple.com/support/third-party-SDK-requirements/. In my app, for example, I have a fork of RxSwift that we build from source and therefore self-sign. That seems reasonable, but it does mean that it will no longer be signed by the vendor. How can I ensure I won't be flagged for using a non–vendor-signed third-party SDK in this case? Thanks, Sam
0
0
91
Jan ’26
Reply to Reduce dyld overhead
OK. I don’t think you can optimise beyond that. Rather, I think you should use that as a baseline for performance work as you evolve your program. Speaking of that, An Apple Library Primer has links to various WWDC talks where the linker team discusses various topics. Most notably, the 2022 talk discusses launch times. It’s well worth a watch. Finally, just for context, the libSystem initialiser does a bunch of really critical stuff. For example, it has the code that sets up the App Sandbox, if the executable enables it. If you want to see this initialiser in action, open your true clone project, set a symbolic breakpoint on libSystem_initializer, and run it from Xcode. When you stop at the breakpoint, Xcode will show a page of disassembled code, but that’s not too hard to understand. And most of the symbols are present, so you can look up the source code in Darwin. IMPORTANT The Darwin open source isn’t guaranteed to match the source used to build the OS, but it’s usually close enough to be quite in
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Recommended alternatives to leaf cert pinning to prevent MITM
Hey there Are there any recommendations or guidance for apps on alternatives to certificate pinning to secure their device network traffic? I want to move away from the overhead and risk associated with rotating certificates when using leaf pinning. However, I also don't want people to be able to perform a MITM attack easily using something like Charles Proxy with a self‑signed certificate added to the trust store. My understanding is that an app cannot distinguish between user‑trusted certificates and system‑trusted certificates in the trust store, so it cannot block traffic that uses user‑trusted certificates.
0
0
53
Jan ’26
State loss and sheets dismiss on backgrounding app
I've been hitting a weird SwiftUI bug with navigation and state loss and I've managed to reproduce in a very tiny sample project. I've submitted a Feedback FB21681608 but thought it was worth posting here incase any SwiftUI experts can see something obviously wrong. The bug With deeper levels of navigation hierarchy SwiftUI will dismiss views when backgrounding the app. Any work around would be appreciated. This happens in a real app where we have to navigate to a settings screen modally and then a complex flow with other sheets. Sample code Happens in the simulator and on device. import SwiftUI struct ContentView: View { @State private var isPresented = false var body: some View { Button(Show first sheet) { isPresented = true } .sheet(isPresented: $isPresented) { SheetView(count: 1) } } } struct SheetView: View { private enum Path: Hashable { case somePath } @State private var isPresented = false var count: Int var body: some View { NavigationStack { VStack { Text(Sheet (c
Topic: UI Frameworks SubTopic: SwiftUI
1
0
108
Jan ’26
Reply to Persisted log entries disappeared?
Each system log entry has time to live (TTL) value. You can see evidence for this in various places within the UI. For example: % sudo log stream … TTL … 0 fseventsd: (libsystem_info.dylib) Resolve user group list … … 7 WindowServer: (SkyLight) [com.apple.SkyLight:KeyboardEvent] kCGSEventKeyUp … AFAIK there’s no supported way to override that, but if you poke around in /System/Library/Preferences/Logging on your Mac it’s not hard to see how it works. WARNING As with all implementation details, there’s no guarantee that this will actually work, or that it hasn’t worked differently in the past, or will work differently in the future. So don’t build knowledge of this into a product that you ship to a wide range of users. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Reply to Content Filter Permission Prompt Not Appearing in TestFlight
Oh, there’s one more thing I should add to the above list: Open source server sample (PIR Service Example) The iOS sample code discusses this, but I can’t over-emphasise how useful it is. On that page you’ll find a link to the server’s documentation, which chock full of interesting info. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Jan ’26
Mobile App OIDC/SAML Login Failures and ITP
We operate a native iOS app that authenticates users via the system browser using OIDC against a 3rd party SaaS authentication broker, which then performs authentication against the individual customer IdPs using SAML within the browser session, and then completes the OIDC login between the broker and our application. Our application initiates the OIDC login using ASWebAuthenticationSession, using the broker’s library, against the broker, and at that point the authentication workflow is handled by the broker. At the beginning of the login session, the broker sets a session-identifying cookie for their domain, before redirecting the user to their company’s identity provider to authenticate, which then redirects the user back to the broker. Intermittently, Mobile Safari does not include that previously set cookie on the final communication with the broker, when being redirected from the IdP as the final step of the SAML portion of the login workflow. When the cookie is missing, the broker cannot correl
0
0
318
Jan ’26
Reply to App review - ipad issue
I have falsified everything for iPad in the code, am not required upload iPad photos, but the reviewers keep being told to judge how my app performs on iPad for some reason. The issue here is that iPads support running iPhone apps in compatibility mode, so all apps should work when run on an iPad. Note that this does NOT mean that their interface expands or otherwise supports the full iPad experience, but simply means that the app functions as expected in compatibility mode. __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Topic: App & System Services SubTopic: Hardware Tags:
Jan ’26
Getting a list of deleted CloudKit records with an expired change token
Usually, when you call fetchRecordZoneChanges with the previous change token, you get a list of the record ID’s that have been deleted since your last fetch. But if you get a changeTokenExpired error because it‘s been too long since you last fetched, you have to call fetch again without a token. For my specific application, I still need to know, though, if any records have been deleted since my last sync. How can I get that information if I no longer have a valid change token?
7
0
399
Jan ’26