Search results for

SwiftUI List performance

50,606 results found

Post

Replies

Boosts

Views

Activity

Reply to AppKit - Legal to Change a View's Frame in -viewDidLayout?
Thanks a lot for responding. Thanks for the post, it’s hard not seeing the code and how you're setting constrains in code. Would you be so kind to provide your code where you setting the constraints so developers here can see it? [..] it is generally not a good idea (and will lead to crashes) to directly modify the frame or bounds of a view that is managed by Auto Layout in my opinion. Initially I did not involve Autolayout at all explicitly. What I had was a small container view controller with something like this (no explicit constraints): @implementation SmallInfoWrapperViewController -(void)viewDidLayout { [super viewDidLayout]; NSRect bounds = self.view.bounds; CGFloat lineHeight = 1.0; self.separator.frame = NSMakeRect(0.0,bounds.size.height-lineHeight,bounds.size.width,lineHeight); BOOL separatorVisible = !self.separator.isHidden; CGFloat wrappedViewHeight = bounds.size.height; if (separatorVisible) { wrappedViewHeight -= lineHeight; } self.wrappedView.frame = NSMakeRect(0.0,0.0,bounds.size.width, wrap
Topic: UI Frameworks SubTopic: AppKit Tags:
Jan ’26
Reply to AppKit - Legal to Change a View's Frame in -viewDidLayout?
Thanks for the post, it’s hard not seeing the code and how you're setting constrains in code. Would you be so kind to provide your code where you setting the constraints so developers here can see it? What do you mean by legal? it is generally not a good idea (and will lead to crashes) to directly modify the frame or bounds of a view that is managed by Auto Layout in my opinion. In my experience any method that directly or indirectly causes setNeedsLayout() or setNeedsDisplay() or changes the frame or bounds of a view that is managed by Auto Layout, may likely trigger the same infinite loop and exception. I think AppKit's layout cycle (especially with Auto Layout) translatesAutoresizingMaskIntoConstraints creates weird fixed width and height constraints leading to Unable to simultaneously satisfy constraints warnings isn’t? When you then add a view add an explicit Auto Layout constraints to a view hierarchy where translatesAutoresizingMaskIntoConstraints is true for some views, you often end up with conflicti
Topic: UI Frameworks SubTopic: AppKit Tags:
Jan ’26
SwiftUI TextEditor: replaced text jumps outside current selection
I have a text editor where I replace the selected text when a button is tapped. Most of the time it works, but sometimes the new text is inserted at the end of the text instead of at the selected position. Is this a bug? @Bindable var note: Richnote @State private var selection = AttributedTextSelection() var body: some View { VStack { TextEditor(text: $note.content, selection: $selection) Button(Replace text) { let textToInsert = A long text that makes me think lalala note.content.replaceSelection(&selection, withCharacters: textToInsert) }
Topic: UI Frameworks SubTopic: SwiftUI
2
0
66
Jan ’26
Why MapKit Is So Unpredictable for macOS?
I have an existing iOS app with MapKit. It always shows the current user location with UserAnnotation. But the same isn't true for macOS. I have this sample macOS application in SwiftUI. In the following, the current user location with a large blue dot appears only occasionally. It won't, 19 of 20 times. Why is that? I do have a location privacy key in Info.plist. And the Location checkbox is on under Signing & Capabilities. import SwiftUI import MapKit struct ContentView: View { @State private var markerItems: [MarkerItem] = [ MarkerItem(name: Farmers Market 1, lat: 35.681, lon: 139.691), MarkerItem(name: Farmers Market 2, lat: 35.685, lon: 139.695), MarkerItem(name: Farmers Market 3, lat: 35.689, lon: 139.699) ] @State private var position: MapCameraPosition = .automatic var body: some View { Map(position: $position) { UserAnnotation() ForEach(markerItems, id: .self) { item in Marker(item.name, coordinate: CLLocationCoordinate2D(latitude: item.lat, longitude: item.lon)) } } .mapControl
0
0
42
Jan ’26
XCode 26.2 (17C52) vs iOS 26.2 (23C55): Cannot mount any DDI onto my device
Hi... Is there not an available Developer Disk Image for this situation? I am unable to do my professional job because I have not been able to overcome this issue on my machine. I have various things to try to resolve this issue so that I can install, run, and test apps onto my iPhone (iPhone 13). The version of MacOSX is Sequoia 15.7.3. I've tried everything from hard resetting the pairing stack, to resetting the trust on my iPhone. I've even sought help from AI. AI says, in a nutshell I'm screwed. Apparently, I am unable to downgrade from iOS 26.2 to, say, iOS 18 or below. I'll be honest: this is frustrating, and this situation seems to happen like clockwork with every update in either direction. I hope someone somewhere has ideas. Thanks. Update: I'm not even reaching the step where the shared Cache symbols are being copied from my iPhone. The developer disk image could not be mounted on this device. Domain: com.apple.dt.CoreDeviceError Code: 12040 Failure Reason: Failed to find a DDI that can be used to e
3
0
420
Jan ’26
Tabview page dots like in the weather app
Hi, I am looking to display (in SwiftUI) the Tabview page dots like in the weather app in the toolbar, an important thing is I want to keep page controls by tapping and scrubbing. Actually, I want to do what's on Apple Design's Page Controls page; here's the link and a photo of what I'd like to do. Could you help me? https://developer.apple.com/design/human-interface-guidelines/page-controls
1
0
78
Jan ’26
Reply to Universal Links are not working in the Xcode 26 simulators
@ranjith_keerthi I need way more information about the issue and the link to the AASA file and the app. Can you provide me that publicly or do you want to send me that privately? swcd logs might show if it successfully fetched your apple-app-site-association file, or if there were parsing errors, network issues, or certificate problems. Messages like Domain not associated with app or No app for URL are strong indicators of a setup problem. Double-check that your domain is listed correctly, prefixed with applinks: (e.g., applinks:yourdomain.com). Can you provide me the app and the AASA link and a description of the issue and we will take it from that? Is everything working on a physical device? Albert Pascual
  Worldwide Developer Relations.
Jan ’26
Does accessing multiple Keychain items with .userPresence force multiple biometric prompts despite reuse duration?
Hi everyone, I'm working on an app that stores multiple secrets in the Keychain, each protected with .userPresence. My goal is to authenticate the user once via FaceID/TouchID and then read multiple Keychain items without triggering subsequent prompts. I am reusing the same LAContext instance for these operations, and I have set: context.touchIDAuthenticationAllowableReuseDuration = LATouchIDAuthenticationMaximumAllowableReuseDuration However, I'm observing that every single SecItemCopyMatching call triggers a new FaceID/TouchID prompt, even if they happen within seconds of each other using the exact same context. Here is a simplified flow of what I'm doing: Create a LAContext. Set touchIDAuthenticationAllowableReuseDuration to max. Perform a query (SecItemCopyMatching) for Item A, passing [kSecUseAuthenticationContext: context]. Result: System prompts for FaceID. Success. Immediately perform a query (SecItemCopyMatching) for Item B, passing the same [kSecUseAuthenticationContext: context].
3
0
519
Jan ’26
How to implement bullet and numbered list functionality in ios26 attributed string text editor
I'm looking to support toggleable bullet and numbered lists in my IOS 26 app. currently my text editor looks like this @Binding var text: AttributedString var requestFocus: Bool = false @State private var selection = AttributedTextSelection() @FocusState private var isFocused: Bool var body: some View { TextEditor(text: $text, selection: $selection) .scrollContentBackground(.hidden) .background(Color.clear) .focused($isFocused) .safeAreaInset(edge: .bottom) { if isFocused { FormattingToolbar(text: $text, selection: $selection) .padding(.horizontal) .padding(.vertical, 8) .background(Color(UIColor.systemBackground)) } } .onChange(of: requestFocus) { _, newValue in if newValue { isFocused = true } } } } i cant find any useful docs on how to best implement this. anything helps, thanks
Topic: UI Frameworks SubTopic: SwiftUI
3
0
169
Jan ’26
tabViewBottomAccessory causes unstable view identity for views accessing Environment or State
Views placed inside tabViewBottomAccessory that access @Environment values or contain @State properties experience unstable identity, as shown by Self._printChanges(). The identity changes on every structural update to the TabView, even though the view's actual identity should remain stable. This causes unnecessary view recreation and breaks SwiftUI's expected identity and lifecycle behavior. Environment Xcode Version 26.2 (17C52) iOS 26.2 simulator and device struct ContentView: View { @State var showMoreTabs = true struct DemoTab: View { var body: some View { Text(String(describing: type(of: self))) } } var body: some View { TabView { Tab(Home, systemImage: house) { DemoTab() } Tab(Alerts, systemImage: bell) { DemoTab() } if showMoreTabs { TabSection(Categories) { Tab(Climate, systemImage: fan) { DemoTab() } Tab(Lights, systemImage: lightbulb) { DemoTab() } } } Tab(Settings, systemImage: gear) { List { Toggle(Show more Tabs, isOn: $showMoreTabs) } } } .tabViewBottomAccessory { AccessoryVie
0
0
58
Jan ’26
Reply to Xcode Cloud builds stuck at App Store Connect
same issue on my self-hosted server via fastlane. Build stucked for 4h and no results. Just wrote infinity: [11:15:51]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) [15:38:00]: Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues) But sometimes it can successfully upload new build... Xcode 26.2.
Jan ’26
Policy on AI-generated assets for Swift Student Challenge 2026
Hello everyone, I am currently developing an app for my Swift Student Challenge submission that focuses on human motion analysis using the Vision framework. To effectively demonstrate the app's technical capabilities during the review process, I need to include a sample video showing a person performing specific movements. However, I want to ensure that my submission strictly adheres to all intellectual property guidelines. Instead of using existing copyrighted videos or public social media clips, I am considering using Generative AI to create an original, royalty-free sample video. This video would feature a character performing movements designed specifically to test my app's pose estimation and feedback logic. I have a few questions regarding this approach: Is it acceptable to use AI-generated sample assets (like video clips) to demonstrate technical features when it's difficult to record high-quality personal footage due to environmental constraints? If I clearly disclose the tools used
0
0
405
Jan ’26