Search results for

SwiftUI List performance

50,605 results found

Post

Replies

Boosts

Views

Activity

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
Reply to How to implement bullet and numbered list functionality in ios26 attributed string text editor
Hello natanbiley, TextEditor does not currently support lists, either parsed from Markdown or otherwise. You could potentially mutate the selection binding to 'manually' insert list symbols and newlines to format selected text into a list. However, this requires implementing your own list structure and formatting, since this workaround does not give you access to the native iOS formatting of lists. Thank you for your patience, Richard Yeh  Developer Technical Support
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
Animation Help
Hello, I am trying to use matchedGeometryEffect to animate between an item in a list view and the item's detail view. Right now, I am getting an unwanted cross-fade animation as the view transitions. So the list item moves into place as it should with the modifier, but it fades out as its detail version fades in, which I do not want. I do not want any fading at all, just the movement from one component to the other. How do I stop this? Thanks.
2
0
72
Jan ’26
Reply to Unable to load a subscription product in the app
As your app is not live yet I assume that you're testing on sandbox, I would also recommend reading the details to trouble shoot on this tech note: TN3186: Troubleshooting In-App Purchases availability in the sandbox. An overview would be: To offer In-App Purchases in your app, call Product.products(for:) with a list of product identifiers (Product ID) matching these products in the sandbox. Product.products(for:) returns an array that includes an instance of Product for each of the In-App Purchases. If Product.products(for:) fails to return a Product instance for your products in the sandbox, validate your product identifier list and confirm you set a price and added localizations for each of the In-App Purchases. After you complete the above checks, retry the product request. If the In-App Purchases are still missing, it may be due to the following reasons: Your bundle ID doesn’t match the bundle ID of an app in App Store Connect. Your bundle ID is disabled for the In-App Purchase capabili
Topic: App & System Services SubTopic: StoreKit Tags:
Jan ’26
Reply to Simulators not showing up in Xcode Version 26.2 (17C52) (Mac OS 26.2 (25C56))
Thanks for the post, can you provide me a better screenshot on the target and device to run the target? Your screenshot looks like target to build against the simulator instead of the run target. Verify that the necessary simulator versions are listed and installed. If not, click the Install button next to the desired versions. What do you see on that screen? As a last resort, if none of the above solutions work, consider uninstalling and reinstalling Xcode. This can help resolve deep-seated installation issues. Albert Pascual
  Worldwide Developer Relations.
Jan ’26
Reply to Cannot see appended AttributedString in NSTextView
Thanks for the post, very interesting. Can you provide the code that is causing that issue? I am not hitting this issue when I add a new string with // What happens when you do this? DispatchQueue.main.async { self.textView.textStorage.append(attributedString) } https://developer.apple.com/documentation/uikit/uitextview/textstorage 
UI updates should always be performed on the main thread. If you're appending attributed strings asynchronously, make sure to wrap your update code in a dispatch to the main queue. Double-check that you're modifying the correct instance. If there are multiple text views or if the text view is being recreated somewhere else in your code, modifications might be applied to the wrong instance. Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: AppKit Tags:
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
419
Jan ’26
Reply to TextEditor scroll to selection
Thanks for your question and post. I hope I can understand exactly what you mean by scrolling. Do you mean scrolling inside a Text? Scrolling to the cursor position in a TextEditor in SwiftUI? Or like with UITextView in UIKit? Do you mean scrolling to a specific part of the text? // Something like this? TextEditor(text: $text) .background( GeometryReader { geometry -> Color in (...) ) To provide a more accurate response, I would appreciate it if you could provide additional context and some code snippets. This will enable us to understand your specific requirements and the exact functionality you are seeking to achieve. Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
UIKit equivalent of SwiftUI .tabRole(.search)?
In SwiftUI, iOS 18+ provides a dedicated Search tab role: Tab(value: .search, role: .search) { Text(This view is intentionally blank) } This displays Search as a separate tab bar item/slot. Is there an official UIKit equivalent for UITabBarController / UITabBarItem? If not, what is Apple’s recommended UIKit approach to achieve the same UX?
Topic: UI Frameworks SubTopic: UIKit
1
0
140
Jan ’26
Xcode Cloud fails to install/launch macOS test runner
When running a SwiftUI Multiplatform app in Xcode Cloud I'm getting the following error: CIWatcher encountered an error in CIWatcherTests failed with: Failed to install or launch the test runner. (Underlying Error: Could not launch “CIWatcherTests”. Runningboard has returned error 5. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn’t be completed. Launch failed. (Underlying Error: Launchd job spawn failed))) This runs fine on iOS and all those tests pass. The SwiftUI app on Mac is a menu bar app so I'm not sure if this could be the issue as it's not launching for some reason on the Xcode Cloud system? Maybe I need to add some run option to make this work? When run locally both iOS and macOS pass all the tests successfully
5
0
1.9k
Jan ’26
Am I allowed to use Speech framework on Swift Student Challenge?
Hello! I would like to use Speech Framework on my App Playground for this year challenge. But I still can't understand if I am allowed to use it to respect the rule of not rely on a network connection. That's why: Speech framework can use on-device Speech recognition – No internet connection needed ✅. But it can ask to download an Apple's native language package to use it for this on-device recognition – To get this, you need to be connected to the Internet ❌. When I try to add a Speech Recognition Capabilities on my App Playground, its' description says: Required to perform speech recognition using Apple's servers. (screenshot is attached). Does it mean that I won't be able to use on-device recognition on my App Playground? – And therefore, only online-version of this framework is available and I can't use it to participate on the challenge successfully❓. If it's possible, could you please make it clearer? This framework is crucial for my App Playground and I really need this to make it work. Thanks
3
0
709
Jan ’26
Reply to How to implement bullet and numbered list functionality in ios26 attributed string text editor
Hello natanbiley, Thanks for your question and sample code. What are you looking to do in terms of support for toggled bullet and numbered lists, in terms of app experience? Do you mean that when a user types into your TextEditor, the string is automatically converted into list format? Or are you asking for something else? Also, what is the FormattingToolbar in this case? Thank you for your patience, Richard Yeh  Developer Technical Support
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’26
Reply to SwiftUI iOS 26 .safeAreaBar issue with large navigation title
I think the question remains; where is .safeAreaBar supposed to be placed, when you're using a ScrollView on the page? I'm also using the .top setting. I haven't been able to find some usage example of this. It seems that if we attach the .safeAreaBar onto the scrollview itself, the scrollview content is correctly offset at first, such that the safeareabar contents do not overlap the scrollviews unless scrolled. If we put the safeareabar higher in the hierarchy, the scrollview contents are not offset and we unfortunately get overlap. Would help a ton to get some insight here. As a workaround, perhaps it would work by putting the safeareabar high in the hierarchy (like onto the first view in the SwiftUI view body), and then manually offsetting the scrollview offset somehow. Still need to figure out how to find the correct offset here...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
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
4w