Search results for

SwiftUI List performance

50,609 results found

Post

Replies

Boosts

Views

Activity

Navigation title is not visible in root of navigation stack of UITabBarController using UITab layout on iPad
Description Title of the view controller is not displayed for the 1st view controller in navigation stack. Is there a way to show it? Main problem is that selected tab is a UITabGroup and there's no way to understand which child of it is currently selected without opening the sidebar or guessing by the content. Human Interface Guidelines In the guidelines there are examples with title visible on the iPad in similar case: https://developer.apple.com/design/human-interface-guidelines/tab-bars Code import UIKit import SwiftUI struct TestView: View { var tab: UITab? let id = UUID() var body: some View { ScrollView { HStack { Spacer() VStack { Text(tab?.title ?? id.uuidString) } Spacer() } .frame(height: 1000) .background(.red) .onTapGesture { tab?.viewController?.navigationController?.pushViewController( TestViewController(nil), animated: true ) } } } } class TestViewController: UIHostingController { let _tab: UITab? init(_ tab: UITab?) { self._tab = tab super.init(rootView: TestView(tab: _tab)) } @MainA
Topic: UI Frameworks SubTopic: UIKit
4
0
266
Jan ’26
Reply to Choppy minimized search bar animation
Dear @DTS Engineer, thank you very much for your continued effort on this matter! Truly appreciate it! I use Xcode Version 26.2 (17C52) and experience this choppy animation in both SwiftUI Canvas and an actual device running iOS26.2. At the same time, I would like to point out that the animation indeed runs smoothly when the TabView is commented out / not used at all (as perhaps in your code). It does not, however, when the TabView is used (as in my initial code). #Preview { if #available(iOS 26, *) { TabView { // Does this cause a problem? Tab { SwiftUIView() } label: { Label(Test, systemImage: calendar) } } } else { // Fallback on earlier versions } } Hopefully this helps to narrow down the source of the issue!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Choppy minimized search bar animation
The new .searchToolbarBehavior(.minimized) modifier leads to a choppy animation both on device and SwiftUI canvas (iOS 26.2): I assume this is not the intended behaviour (reported under FB21572657), but since I almost never receive any feedback to my reports, I wanted to see also here, whether you experience the same, or perhaps I use the modifier incorrectly? struct SwiftUIView: View { @State var isSearchPresented: Bool = false @State var searchQuery: String = var body: some View { TabView { Tab { NavigationStack { ScrollView { Text(isSearchPresented.description) } .navigationTitle(Test) } .searchable(text: $searchQuery, isPresented: $isSearchPresented) .searchToolbarBehavior(.minimize) // **Choppy animation comes from here?** } label: { Label(Test, systemImage: calendar) } Tab { Text(123) } label: { Label(123, systemImage: globe) } } } } #Preview { if #available(iOS 26, *) { SwiftUIView() } else { // Fallback on earlier versions } }
4
0
337
Jan ’26
CXCallDirectoryProvider – Numbers added but blocking not working
Hi all, I'm working on a Call Directory Extension using CXCallDirectoryExtensionContext. I want to add a list of numbers to be blocked. Here's the function I use: override func beginRequest(with context: CXCallDirectoryExtensionContext) { context.delegate = self let blockedNumbers = loadNumberEntries(forKey: blockedKey) let identifiedNumbers = loadNumberEntries(forKey: identifiedKey) addAllBlocking(blockedNumbers, to: context) addAllIdentification(identifiedNumbers, to: context) context.completeRequest() } private func addAllBlocking(_ entries: [NumberEntry], to context: CXCallDirectoryExtensionContext) { let numbers: [Int64] = entries.compactMap { Int64($0.countryCode + $0.phone) }.sorted() for number in numbers { context.addBlockingEntry(withNextSequentialPhoneNumber: number) print(# Added blocking entry: (number)) } } When I run this, I see in the console: # Added blocking entry: (*my number with country code*) So it seems the number is added correctly. However, in practice, the number is not bloc
1
0
901
Jan ’26
iOS App rejected
Guideline 2.5.1 - Performance - Software Requirements The app uses or references the following non-public or deprecated APIs: Iobmobile Classes: • __SwiftValue The use of non-public or deprecated APIs is not permitted, as they can lead to a poor user experience should these APIs change and are otherwise not supported on Apple platforms. Can anyone she some light as to what __SwiftValue even means?
9
0
557
Jan ’26
Reply to Multi-machine Code Signing
After playing with builds and code signing over this weekend, I'm now not sure my original idea about this failure is correct. It's rather something about rebooting the machine that makes the magic work. If I work on a source tree, editing files, checking things into and out of source code control, performing builds or parts of builds, etc., code signing the final build often fails. If I reboot the system and make the full build right away, before doing anything else, it works. Some tool that I use must be corrupting it. Unless someone knows ways to interfere with code signing that might align with this, I will take this away and try to gather more information. Thanks for your help so far.
Jan ’26
Reply to Virtual Machine UDID Changes in macOS 15: Looking for Guidance on Development Workflow
We are using an open-source project called UTM (https://github.com/utmapp/UTM) for managing our virtual machine infra. The way how cloning works in our current workflow is by taking an existing visual machine (a UTM bundle file) and copying it with cp command and updating the metadata to avoid clashes with existing virtual machines like so cp -cR $template_file $clone_file xmlstarlet ed --inplace -u '//key[.=Name]/following-sibling::string[1]' -v $clone_name ${clone_file}/config.plist xmlstarlet ed --inplace -u '//key[.=MacAddress]/following-sibling::string[1]' -v $new_mac_address ${clone_file}/config.plist After that, the newly copied virtual machine file is opened with UTM app with open command open -a UTM $clone_file It appears in the list of registered virtual machines and it's booted up. So I suspect that the UTM app is just opening the virtual machine and treating it as a separate entity. However, this approach allowed us to preserve provisioning UDID so far. There is one curious detail that we
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’26
Reply to JavaScript/Swift Interoperability
If you have a suggestion, you should raise it at: https://feedbackassistant.apple.com/ When doing so, I recommend you list the specific APIs you want, and the justification for them. A suggestion that Apple just implement some of the missing APIs won't get very far.
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’26
Reply to Choppy minimized search bar animation
Dear @DTS Engineer, Thank you for your reply and suggested way forward. I reduced the code to the minimum for further testing purposes: struct SwiftUIView: View { @State var searchQuery: String = var body: some View { NavigationStack { ScrollView { Text(Test) } .navigationTitle(Test) } .searchable(text: $searchQuery) .searchToolbarBehavior(.minimize) } } #Preview { if #available(iOS 26, *) { TabView { Tab { SwiftUIView() } label: { Label(Test, systemImage: calendar) } } } else { // Fallback on earlier versions } } I did not remove .searchable as per your suggestion since without it the .searchToolbarBehavior(.minimize) does not appear to have any effect (the search button is simply not shown). The code above still leads to the same choppy animation as demonstrated in my initial message. As further testing, I tried to extract the NavigationStack view to a separate view (similarly to here), and to remove ScrollView or replace it with a List, but to no success. Hopefully this is helpful.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’26
Reply to Multi-machine Code Signing
Thanks for the replies. You are both quite right that I should have provided more information. When I say that notarization succeeds, I mean that I submit the dmg file produced by the build to the Apple notarization service and receive a status of 'Accepted'. I take this to mean all is well. When I say that notarization fails, I mean that the notarization step produces a status of 'Invalid'. Retrieving the notarization log indicates that the binaries were not signed. I've just gone through this again with my two machines. The build here is performed by scripts that are maintained in source code control and forced to be identical in both setups. The build infrastructure is also the same for both. Before beginning, both machines were powered off for a period of time. Power up one machine. Ensure the source tree is up-to-date. Run the build to produce a signed dmg. Submit it for notarization. The submission produces a status of Accepted. Power down the first machine. Power up the second machine. Again e
Jan ’26
Unable to profile Metal app on M2 Ultra (profiling works on M3 Pro)
On MacBook Pro M3 14 I can profile the Metal App performance by running it, then clicking on the M icon and choosing profile after replay. On Mac Studio M2 Ultra I cannot: the profiler starts and crashes. I have tried everything including reinstalling the OS, Xcode, the Metal SDK, you name it. The app uses the Metal 4 API. The content of the replayer errorinfo report is shown at the end. Any ideas what is going on here and/or what else I can do do root cause this and fix it? FWIW, it was worse on 26.1 (Xcode just reported Metal 4 profiling not available). In 26.2 Xcode attempts to profile and invariably crashes. === Error summary: === 1x DYErrorDomain (512) - guest app crashed (512) 1x com.apple.gputools.MTLReplayer (100) - Abort trap: 6 === First Error === Domain: DYErrorDomain Error code: 512 Description: guest app crashed (512) GTErrorKeyPID: 26913 GTErrorKeyProcessName: GPUToolsReplayService GTErrorKeyCrashDate: 2026-01-09 19:22:52 +0000 === Underlying Error #1 === Domain: com.apple.gputools.MTLR
1
0
381
Jan ’26
Reply to Best practice for centralizing SwiftData query logic and actions in an @Observable manager?
A SwiftData query (@Query) is currently tied to a SwiftUI view and relies on the modelContext environment value of the view. There is currently no way to use @Query outside of a SwiftUI view. To implement the query logics in a controller class, you basically need to to do the following with your own code: Fetch data using FetchDescriptor + ModelContext.fetch. Update the result set when relevant changes happen. To do step 2, assuming you are using the SwiftData default store, which is based on Core Data, you need to observe the notifications triggered by a store change (basically NSManagedObjectContextObjectsDidChange and .NSPersistentStoreRemoteChange), check if the change is relevant, and re-fetch the data set as needed. All these will be a bit involved, and yet have already implemented (as Query) on the framework side. I'd hence suggest that you file a feedback report to request an API that does what Query does but doesn't rely on SwiftUI – If you do so, please share your report I
Jan ’26
Best practice for centralizing SwiftData query logic and actions in an @Observable manager?
I'm building a SwiftUI app with SwiftData and want to centralize both query logic and related actions in a manager class. For example, let's say I have a reading app where I need to track the currently reading book across multiple views. What I want to achieve: @Observable class ReadingManager { let modelContext: ModelContext // Ideally, I'd love to do this: @Query(filter: #Predicate { $0.isCurrentlyReading }) var currentBooks: [Book] // ❌ But @Query doesn't work here var currentBook: Book? { currentBooks.first } func startReading(_ book: Book) { // Stop current book if any if let current = currentBook { current.isCurrentlyReading = false } book.isCurrentlyReading = true try? modelContext.save() } func stopReading() { currentBook?.isCurrentlyReading = false try? modelContext.save() } } // Then use it cleanly in any view: struct BookRow: View { @Environment(ReadingManager.self) var manager let book: Book var body: some View { Text(book.title) Button(Start Reading) { manager.startReading(book) } if man
1
0
347
Jan ’26