Search results for

SwiftUI List performance

50,598 results found

Post

Replies

Boosts

Views

Activity

Zoom navigation transitions for tabViewBottomAccessory are not working in SwiftUI with ObservableObject or Observable
The zoom navigation transition with matchedTransitionSource in tabViewBottomAccessory does not work when a Published var in an ObservableObjector Observable gets changed. Here is an minimal reproducible example with ObservableObject: import SwiftUI import Combine private final class ViewModel: ObservableObject { @Published var isPresented = false } struct ContentView: View { @Namespace private var namespace @StateObject private var viewModel = ViewModel() // @State private var isPresented = false var body: some View { TabView { Button { viewModel.isPresented = true } label: { Text(Start) } .tabItem { Image(systemName: house) Text(Home) } Text(Search) .tabItem { Image(systemName: magnifyingglass) Text(Search) } Text(Profile) .tabItem { Image(systemName: person) Text(Profile) } } .sheet(isPresented: $viewModel.isPresented) { Text(Sheet) .presentationDragIndicator(.visible) .navigationTransition(.zoom(sourceID: tabViewBottomAccessoryTransition, in: namespace)) } .tabViewBottomAccessory { Button { viewMo
5
0
300
2d
Reply to Wanted: Live Activities, only on iOS (No remote iOS Live Activities)
Thank you for your post. I must admit that I am not entirely clear on your question regarding creating a Live Activity for a remote hosting environment. I believe I may have misunderstood your inquiry. Could you please provide me with additional details to clarify your objectives? As currently, Live Activities are designed primarily for iOS devices, and they appear on the Lock Screen and Control Center. December 16, 2025 Updated guidance for all platforms, and added guidance for macOS and CarPlay. https://developer.apple.com/design/human-interface-guidelines/live-activities/ If you want to bring Live Activities to Apple Watch: https://developer.apple.com/videos/play/wwdc2024/10068/ Including the documentation for the live activities guide. The widget configuration api to position a widget: https://developer.apple.com/documentation/swiftui/widgetconfiguration/disfavoredlocations(_:for:) Thanks, Albert Pascual
  Worldwide Developer Relations.
2d
Reply to Background execution window after CLBeaconRegion wake from terminated state
I am testing my iOS app on iOS 18. I performed 50 tests, and in 43–44 of them, the app successfully detects beacons, relaunches in the background, and continues BLE communication. Testing how? What are the details of the process you're actually using to test this? That is, are you: Artificial Testing” -> Laying the phone on a desk next to the beacon and toggling the beacon (or shielding the phone) on/off to simulate entry and exit. VS. Real World Testing” -> Carrying the phone around in your pocket and seeing what happens. Beyond that, what are the broader parameters of the test itself? How far is the device from the beacon? How long is the device exposed to the beacon? What's the broader use case you're trying to implement? Most importantly, what, if anything, do you know about EXACTLY what was happening when the failure occurred? I want to understand why beacon triggers are inconsistent in iOS. What are the common reasons behind iOS not relaunching the app for beacon events, and what factors
2d
Reply to NFC support in iOS application in India
First, please check the document NFC & SE Platform for secure contactless transactions for the requirements and regional availability of NFC support with Secure Element. NFCTagReaderSession cannot be used for payment cards. You will need to use alternate CoreNFC APIs, which are only available via special entitlements and agreements. The document above will also explain the requirements for getting access to those APIs. Eventually, you will need to enter into an agreement with Apple and request the NFC & SE Platform Entitlement, if you satisfy the requirements as listed in the document above. If you are not able to use those APIs, PassKit framework will be your only remaining option, if appropriate. If you have already requested the relevant entitlements, if approved, you will receive further guidance on how to proceed with your development.
2d
Reply to Application Hangs with Nested LazyVStack When Accessibility Inspector is Active
Hello @mike sldkcjnsdmhvbsdh I can see the code you submitted and have some insight. However, I am not the engineering team handling this report and would continue to refer to the status and discussion in Feedback Assistant, but I do have some insight. See your line 40 of NestedLazyVStackView .onAppear { // ⚠️ HANG TRIGGER POINT LazyVStacks allocates views as they are needed and here SwiftUI is modifying its content through state changes while that is happening. This creates a race condition. Traversing the accessibility tree will cause unexpected issues in this situation. For more info on the best practices building performant layouts, see: Building layouts with stack views and Creating performant scrollable stacks I hope this helps!  Travis Trotto - DTS Engineer
2d
Application Hangs with Nested LazyVStack When Accessibility Inspector is Active
Description I've encountered a consistent hang/freeze issue in SwiftUI applications when using nested LazyVStack containers with Accessibility Inspector (simulator) or VoiceOver (physical device) enabled. The application becomes completely unresponsive and must be force-quit. Importantly, this hang occurs in a minimal SwiftUI project with no third-party dependencies, suggesting this is a framework-level issue with the interaction between SwiftUI's lazy view lifecycle and the accessibility system. Reproduction Steps I've created a minimal reproduction project available here: https://github.com/pendo-io/SwiftUI_Hang_Reproduction To Reproduce: Create a SwiftUI view with the following nested LazyVStack structure: struct NestedLazyVStackView: View { @State private var outerSections: [Int] = [] @State private var innerRows: [Int: [Int]] = [:] var body: some View { ScrollView { LazyVStack(alignment: .leading, spacing: 24) { ForEach(outerSections, id: .self) { section in VStack(ali
4
0
236
2d
UIHostingConfiguration focus problem on tvOS, with SwiftUI view
UIHostingConfiguration on tvOS: focus permanently broken with multiple focusable SwiftUI views Hi everyone, I'm working on a tvOS app with a UICollectionView. Some cells embed SwiftUI content via UIHostingConfiguration, specifically a row of 3 buttons that should be individually focusable. The cell itself returns canBecomeFocused = false so focus passes through to the SwiftUI buttons. The problem: after navigating focus into that section once, it becomes permanently unfocusable. Focus enters briefly, then immediately exits to nil on its own, without any user input. From that point on, the focus engine completely skips the section. The exact same SwiftUI view works perfectly when embedded via UIHostingController instead. How to reproduce Press DOWN to move focus into the UIHostingConfiguration section Focus lands on a SwiftUI button for a split second Focus exits on its own and bumps to another section The section is now dead, focus skips it on every subsequent navi
1
0
18
3d
Reply to Background execution window after CLBeaconRegion wake from terminated state
I am testing my iOS app on iOS 18. I performed 50 tests, and in 43–44 of them, the app successfully detects beacons, relaunches in the background, and continues BLE communication. However, in a few cases, beacon detection does not trigger, and the background BLE process fails. I want to understand why beacon triggers are inconsistent in iOS. What are the common reasons behind iOS not relaunching the app for beacon events, and what factors affect reliable BLE/background beacon detection?
3d
Reply to Does 'perform(schedule: .immediate)' guarantee serial execution?
Every NSManagedObjectContext has a private serial dispatch queue. perform(schedule: .immediate) runs the block immediately, if the code is currently running in the dispatch queue of the managed object context. Otherwise, it does perform(schedule: .enqueue), which enqueues the block to the context's dispatch queue. In your code snippet, you use await to serialize the two performs, and so for every single doSomething, the system guarantees that the first block (add log event 1) is done BEFORE the second one (add log event 2) is started. Maybe worth mentioning, like other async functions, doSomething can be re-entered. Assuming that doSomething is called twice, it's possible that the first block of the second doSomething is enqueued before the second block of the first doSomething is. Best, —— Ziqiao Chen  Worldwide Developer Relations.
3d
Does 'perform(schedule: .immediate)' guarantee serial execution?
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?
1
0
57
3d
Reply to iBeacon Monitoring in Flutter App: Background Wake-Up from Killed State, Time Limits for BLE, and Handling Multiple Regions/Identifiers
There are a few questions in this block. Let me try to take them apart. Background Execution Time After Wake-Up: When the app is woken in the background by a region monitoring event (enter/exit) from a killed state, approximately how much time (in seconds) does iOS allocate for the app to run before suspending it again? You can generally expect about 10 seconds when the app is woken up. This is the total time. If the app has been terminated, depending on how long it takes for your app to finish launching, you would end up with less than that. The beginBackgroundTask(expirationHandler:) API can be used to request up to 30 seconds, but it is not guaranteed that you will get that much. The system can also re-suspend or terminate your app in much shorter a time if it needs the resources your app is using urgently. Is this sufficient for performing BLE operations like ranging beacons or establishing a short connection, or are there stricter limits in terminated wake-ups compared to standard background mod
3d
iBeacon Monitoring in Flutter App: Background Wake-Up from Killed State, Time Limits for BLE, and Handling Multiple Regions/Identifiers
Hello Apple Developer Community, I'm developing a cross-platform app using Flutter and the flutter_beacon library to handle iBeacon detection on iOS. My goal is to wake up the app in the background when it's in a killed/terminated state upon entering/exiting beacon regions, allowing for BLE communication (e.g., ranging or connecting to beacons). I've configured the necessary Info.plist keys for always location access and background location modes, and it works partially for single regions, but I have some specific questions/issues regarding reliability and limitations: Background Execution Time After Wake-Up: When the app is woken in the background by a region monitoring event (enter/exit) from a killed state, approximately how much time (in seconds) does iOS allocate for the app to run before suspending it again? Is this sufficient for performing BLE operations like ranging beacons or establishing a short connection, or are there stricter limits in terminated wake-ups compared to standard background
1
0
95
3d
IAP Missing From Build
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
2
0
71
3d
Keyboard Toolbar Padding iOS26
When I create a SwiftUI toolbar item with placement of .keyboard on iOS 26, the item appears directly on top of and in contact with the keyboard. This does not look good visually nor does it match the behavior seen in Apple's apps, such as Reminders. Adding padding to the contents of the toolbar item only expands the size of the item but does not separate the capsule background of the item from the keyboard. How can I add vertical padding or spacing to separate the toolbar item capsule from the keyboard?
Topic: UI Frameworks SubTopic: SwiftUI
9
0
731
3d
Wrong position of searchable component on first render
Hey all, I found a weird behaviour with the searchable component. I created a custom bottom nav bar (because I have custom design in my app) to switch between screens. On one screen I display a List component with the searchable component. Whenever I enter the search screen the first time, the searchable component is displayed at the bottom. This is wrong. It should be displayed at the top under the navigationTitle. When I enter the screen a second time, everything is correct. This behaviour can be reproduced on all iOS 26 versions on the simulator and on a physical device with debug and release build. On iOS 18 everything works fine. Steps to reproduce: Cold start of the app Click on Search TabBarIcon (searchable wrong location) Click on Home TabBarIcon Click on Search TabBarIcon (searchable correct location) Simple code example: import SwiftUI struct ContentView: View { @State var selectedTab: Page = Page.main var body: some View { NavigationStack { ZStack { VStack { switch selectedTab { c
2
0
121
4d