Search results for

“swiftui”

17,110 results found

Post

Replies

Boosts

Views

Activity

SwiftUI Instruments tool error: "Time Profiler: Time Profiler does not support the iOS platform"
I am trying to run the SwiftUI instruments tool for an iOS app and every time I run it, it either switches from giving me the Time Profiler: Time Profiler does not support the iOS platform error, or I end up with no data at all; however, when I run just the Time Profiler by itself it works fine. I am running this on a physical device
1
0
328
Mar ’26
Reply to TextKit 2 + SwiftUI (NSViewRepresentable): NSTextLayoutManager rendering attributes don’t reliably draw/update
Thanks for sharing more information. Even without SwiftUI, addRenderingAttribute + invalidateLayout doesn't refresh the text view (NSTextView) either (though the text view does refresh with the right rendering attribute after I resize the app window), which I believe is worth a feedback report, and would suggest that you file one and share your report ID here. Before the issue is addressed, a workaround I can see is to use display attributes for that purpose – When loading the the text storage, UI/NSTextView calls textContentStorage(_:textParagraphWith:), and you can implement the method to set up display attributes for the text coloring, and return an appropriate NSTextParagraph, as shown in the following code example: extension ViewController: NSTextContentStorageDelegate { func textContentStorage(_ textContentStorage: NSTextContentStorage, textParagraphWith range: NSRange) -> NSTextParagraph? { let paragraphText = textContentStorage.textStorage!.attributedSubstring(from: range) let paragraphStr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’26
Reply to ppq.apple.com returning 502 Bad Gateway - Unable to verify developer apps on device
I've gotten OK, Bad-Gateway, Gateway Time-Out on four different systems. Even when OK is returned, it takes a while to get a response. This started almost exactly at 10am pacific time for me. Like many of you I used the security command line to check my certs, checked my firewall (PFSense), and even switch my build system and my target iPad to use my iPhone personal hot-spot, in order to bypass my infrastructure and still, no-joy. After reading your posts, I have become convinced that this is an Apple services issue, even though their status page says everything is working. More information. I have another project (Project-B) I'm working on, which is being developed on a different machine. Project-B installs on the same target iPad with no issues. I migrated the failing project (Project-A) over to this machine and added the missing certificates to the keychain so that the failing project would build. Even on this second system, I'm consistently getting the error for project-a but not for project-b. So, appare
Mar ’26
Title Notarization submissions stuck “In Progress” for 5+ days (SwiftUI macOS menu bar app)
Notarization submissions stuck “In Progress” for 5+ days (SwiftUI macOS menu bar app) Hello, I’m experiencing an issue where all notarization submissions remain “In Progress” for several days. Environment macOS native app written in Swift / SwiftUI Menu bar application Built with Xcode Developer ID Application signing Hardened Runtime enabled App Sandbox disabled Uses SMAppService for “Start at Login” Artifact structure ClaudeUsageTracker.zip └ ClaudeUsageTracker.app (no nested directory) Verification codesign --verify --deep --strict --verbose=2 ClaudeUsageTracker.app This succeeds without errors. Notarization submissions 2026-03-06 — In Progress ID=215814fc-57c5-4f99-88fe-ed2db4d3e3d9 2026-03-06 — In Progress ID=70948178-191c-4840-a9c7-52c321b725e5 2026-03-09 — In Progress ID=14a88b79-df4d-4d83-9bfe-fa6eafc9bf76 All submissions remain In Progress for 5+ days, and notarytool log is not available yet. Command used xcrun notarytool submit ClaudeUsageTracker.zip --keychain-profile notarytool-
9
0
503
Mar ’26
Reply to Switching to custom keyboard size glitches
I’m having the exact same issue. my setup - UIInputViewController subclass - A UIHostingController wrapping our SwiftUI view, added as a child view controller - The hosting controller's view is pinned to self.view with Auto Layout constraints (leading, trailing, top, bottom) - The SwiftUI view has a fixed .frame(height: 260) - No custom UIInputView, no allowsSelfSizing I’ve tried: explicit frames, height constraints, UIInputView vs direct self.view, disabling UIHostingController keyboard avoidance, runtime overrides of _UIHostingView notification handlers). None had any effect.
Topic: UI Frameworks SubTopic: UIKit
Mar ’26
DeviceActivityReportExtension sandbox blocks all output channels — how to export resolved Application.bundleIdentifier?
DeviceActivityReportExtension sandbox blocks all output channels — how to export resolved Application.bundleIdentifier? Application.bundleIdentifier only resolves to a non-nil value inside a DeviceActivityReportExtension (ExtensionKit/XPC). The main app and DeviceActivityMonitor extension always return nil. However, the Report Extension's sandbox silently blocks every output channel I've tested: UserDefaults (App Group): Reads succeed, writes silently dropped File writes (App Group container): Fail silently or throw HTTP requests: Network blocked entirely Local Notifications: Couldn't communicate with a helper application UIPasteboard: Writes silently fail iCloud KVS: synchronize() returns false Both targets share the same com.apple.security.application-groups entitlement and group identifier. The main app reads and writes to the shared container normally — only the extension's writes fail. This means resolved bundle identifiers can only be rendered in the extension's own SwiftUI view and cannot be c
4
0
235
Mar ’26
File Export from iOS - eventually import too
iOS 15 - iOS 26.x, SwiftUI, Xcode 26.1.1 (rewritten without links) I’m attempting to add the capability to export a file from CoreData. Since ShareLink requires iOS16+, I found an article showing how to create a UIKit wrapper for 'UIActivityViewController' This does work, but I end up with multiple files instead of one. How do I merge this into one file? Note: I don’t think I want to write to the app’s document directory – rather I’d like to allow the user to export to iCloud. Eventually, I’d like to share a list of dates with descriptions and if someone puts a sensitive date in there – I don’t want it to be left in a directory. I would include a warning that the file that they export needs to be handled with care if there are any sensitive dates. Some might consider birthdays as private information, right? I'd also like to be able to name the file - so far when the share sheet comes up, I select Save to Files and it uses a default name of text.txt My next step is to be able to import a CSV file (rou
Topic: UI Frameworks SubTopic: SwiftUI
6
0
356
Mar ’26
Access Screen Time total usage from main app when using DeviceActivityReportExtension
I am building a simple iOS app that shows the total phone usage time for today using the Screen Time APIs. Architecture: Main app → requests authorization using AuthorizationCenter.shared.requestAuthorization(for: .individual) → displays a DeviceActivityReport Report extension → DeviceActivityReportExtension → calculates total usage using DeviceActivityResults → shows the number in a SwiftUI view The report works correctly. The extension successfully calculates the total usage and displays it on screen. Example logic inside the report extension: for await activityData in data { for await segment in activityData.activitySegments { totalSeconds += segment.totalActivityDuration } } let totalMinutes = Int(totalSeconds / 60) The problem: I need the main app to access that number so I can store it daily in my own database. I tried to send the value from the extension to the main app using: App Group + UserDefaults(suiteName:) App Group + shared file (FileManager.containerURL) writing inside makeConfigurati
1
0
246
Mar ’26
Reply to NavigationTitle in LiquidGlass style
To achieve a LiquidGlass navigation title style in SwiftUI similar to what you see in macOS apps like Photos, you'll need to customize the appearance beyond what's available with standard SwiftUI modifiers. The LiquidGlass effect typically involves a semi-transparent, blurred background that reacts dynamically to the content beneath it. While SwiftUI doesn't directly support a LiquidGlass effect out of the box, you can create a custom view to mimic this behavior. Here's a basic approach to get you started: Custom LiquidGlass Navigation Title import` SwiftUI` struct LiquidGlassEffect: ViewModifier { var color: Color = .white var opacity: Double = 0.6 func body(content: Content) -> some View { content .background( GeometryReader { geometry in Color.clear .blur(radius: 10) .frame(width: geometry.size.width, height: geometry.size.height) .opacity(opacity) .blendMode(.destinationOver) .background(color.opacity(0.1)) } .edgesIgnoringSafeArea(.top) ) .overlay(
Topic: Design SubTopic: General Tags:
Mar ’26
RequestReview API does not trigger the review sheet in Xcode testing iPadOS 26.4 beta 3
Hello DTS team, the request review from StoreKit is not working in iOS 26.4 beta 3. I have filed a feedback (FB22157147). Sample code: import SwiftUI import StoreKit struct ContentView: View { @Environment(.requestReview) private var requestReview @State private var count = 0 var body: some View { VStack { Button(Increase Count) { count += 1 } Text(count, format: .number) .font(.largeTitle) } .onChange(of: count) { if count == 3 { Task { try await Task.sleep(for: .seconds(2)) requestReview() print(Request Review triggered!) // On iPadOS 26.4 beta 2 & 3, requestReview() does not trigger any review system sheet when testing in Xcode 26.3 // Works on iOS 26.3.1 } } } } }
0
0
218
Mar ’26
Reply to SwiftUI and undo
Undo and redo operations are implemented in SwiftUI TextEditors and TextFields by default. If you want to manage these actions: See UndoManager https://developer.apple.com/documentation/foundation/undomanager For your multi-platform app, SwiftUI has an environment value for that: .undoManager. https://developer.apple.com/documentation/swiftui/environmentvalues/undomanager Here's an example of .undoManager used to disable Undo. struct ContentView: View { @Environment(.undoManager) var undoManager: UndoManager? var body: some View { VStack { TextEditor(text: $text) } .task { undoManager?.disableUndoRegistration() } } } If you still have questions, feel free to provide more information here.  Travis
Topic: UI Frameworks SubTopic: SwiftUI
Mar ’26
SwiftUI and undo
In my multiplatform SwiftUI document app, where should I implement undo? In the Views with Forms and Lists, Bindings, data classes or somewhere else? I am now implementing undo in Bindings and Lists, but I'm wondering if that's the right way to do it.
Topic: UI Frameworks SubTopic: SwiftUI
2
0
169
Mar ’26
SwipeActions-triggered reorder animation briefly removes row and re-inserts it
I’m seeing a visual glitch in SwiftUI List on iOS 26 when row order changes after a swipeActions action. Setup: List + ForEach of items Items are sorted dynamically by isSelected (unselected first, selected last) Swipe action toggles isSelected Row should animate to new position Problem: On swipe select/unselect, the row sometimes appears to disappear briefly, then reappear in the new position Most visible when unselecting an item from the bottom selected group (it should move to top) Sometimes there is a temporary “empty gap” near the top during the move In some row styling setups, row corner masking also looks wrong during animation What I tried: Different animations (default, easeInOut, spring) Adding/removing small dispatch delay before state change Moving section header content outside List Using custom row backgrounds/corners vs system row styling Keeping stable IDs in ForEach Behavior still appears with native List + swipeActions on iOS 26. So my question is: Is this a known issue/regression w
Topic: UI Frameworks SubTopic: SwiftUI
0
0
119
Mar ’26
What is the lifecycle of onReceive subscriptions in SwiftUI views?
I'm trying to better understand how the onReceive modifier behaves in SwiftUI, specifically how its subscription lifecycle relates to view updates. Consider this example: TextField(Name, text: $name) .onReceive(Just(name)) { value in print(value) } This closure runs every time name changes. A common explanation is that SwiftUI recomputes body, which creates a new Just(name) publisher each time. However, this raises some questions for me about how onReceive actually works internally: When SwiftUI recomputes body, is the onReceive modifier recreated and resubscribed? Does SwiftUI automatically cancel the previous subscription when the view updates?
0
0
76
Mar ’26
SwiftUI Instruments tool error: "Time Profiler: Time Profiler does not support the iOS platform"
I am trying to run the SwiftUI instruments tool for an iOS app and every time I run it, it either switches from giving me the Time Profiler: Time Profiler does not support the iOS platform error, or I end up with no data at all; however, when I run just the Time Profiler by itself it works fine. I am running this on a physical device
Replies
1
Boosts
0
Views
328
Activity
Mar ’26
Reply to TextKit 2 + SwiftUI (NSViewRepresentable): NSTextLayoutManager rendering attributes don’t reliably draw/update
Thanks for sharing more information. Even without SwiftUI, addRenderingAttribute + invalidateLayout doesn't refresh the text view (NSTextView) either (though the text view does refresh with the right rendering attribute after I resize the app window), which I believe is worth a feedback report, and would suggest that you file one and share your report ID here. Before the issue is addressed, a workaround I can see is to use display attributes for that purpose – When loading the the text storage, UI/NSTextView calls textContentStorage(_:textParagraphWith:), and you can implement the method to set up display attributes for the text coloring, and return an appropriate NSTextParagraph, as shown in the following code example: extension ViewController: NSTextContentStorageDelegate { func textContentStorage(_ textContentStorage: NSTextContentStorage, textParagraphWith range: NSRange) -> NSTextParagraph? { let paragraphText = textContentStorage.textStorage!.attributedSubstring(from: range) let paragraphStr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to ppq.apple.com returning 502 Bad Gateway - Unable to verify developer apps on device
I've gotten OK, Bad-Gateway, Gateway Time-Out on four different systems. Even when OK is returned, it takes a while to get a response. This started almost exactly at 10am pacific time for me. Like many of you I used the security command line to check my certs, checked my firewall (PFSense), and even switch my build system and my target iPad to use my iPhone personal hot-spot, in order to bypass my infrastructure and still, no-joy. After reading your posts, I have become convinced that this is an Apple services issue, even though their status page says everything is working. More information. I have another project (Project-B) I'm working on, which is being developed on a different machine. Project-B installs on the same target iPad with no issues. I migrated the failing project (Project-A) over to this machine and added the missing certificates to the keychain so that the failing project would build. Even on this second system, I'm consistently getting the error for project-a but not for project-b. So, appare
Replies
Boosts
Views
Activity
Mar ’26
Reply to Wrong appearance of decimalPad keyboard in dark mode
Same issue in SwiftUI while using .keyboardType(.numberPad) in combination with .preferredColorScheme(.dark). I'm afraid it's iOS / iPadOS bug.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’26
Title Notarization submissions stuck “In Progress” for 5+ days (SwiftUI macOS menu bar app)
Notarization submissions stuck “In Progress” for 5+ days (SwiftUI macOS menu bar app) Hello, I’m experiencing an issue where all notarization submissions remain “In Progress” for several days. Environment macOS native app written in Swift / SwiftUI Menu bar application Built with Xcode Developer ID Application signing Hardened Runtime enabled App Sandbox disabled Uses SMAppService for “Start at Login” Artifact structure ClaudeUsageTracker.zip └ ClaudeUsageTracker.app (no nested directory) Verification codesign --verify --deep --strict --verbose=2 ClaudeUsageTracker.app This succeeds without errors. Notarization submissions 2026-03-06 — In Progress ID=215814fc-57c5-4f99-88fe-ed2db4d3e3d9 2026-03-06 — In Progress ID=70948178-191c-4840-a9c7-52c321b725e5 2026-03-09 — In Progress ID=14a88b79-df4d-4d83-9bfe-fa6eafc9bf76 All submissions remain In Progress for 5+ days, and notarytool log is not available yet. Command used xcrun notarytool submit ClaudeUsageTracker.zip --keychain-profile notarytool-
Replies
9
Boosts
0
Views
503
Activity
Mar ’26
Reply to Switching to custom keyboard size glitches
I’m having the exact same issue. my setup - UIInputViewController subclass - A UIHostingController wrapping our SwiftUI view, added as a child view controller - The hosting controller's view is pinned to self.view with Auto Layout constraints (leading, trailing, top, bottom) - The SwiftUI view has a fixed .frame(height: 260) - No custom UIInputView, no allowsSelfSizing I’ve tried: explicit frames, height constraints, UIInputView vs direct self.view, disabling UIHostingController keyboard avoidance, runtime overrides of _UIHostingView notification handlers). None had any effect.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Mar ’26
DeviceActivityReportExtension sandbox blocks all output channels — how to export resolved Application.bundleIdentifier?
DeviceActivityReportExtension sandbox blocks all output channels — how to export resolved Application.bundleIdentifier? Application.bundleIdentifier only resolves to a non-nil value inside a DeviceActivityReportExtension (ExtensionKit/XPC). The main app and DeviceActivityMonitor extension always return nil. However, the Report Extension's sandbox silently blocks every output channel I've tested: UserDefaults (App Group): Reads succeed, writes silently dropped File writes (App Group container): Fail silently or throw HTTP requests: Network blocked entirely Local Notifications: Couldn't communicate with a helper application UIPasteboard: Writes silently fail iCloud KVS: synchronize() returns false Both targets share the same com.apple.security.application-groups entitlement and group identifier. The main app reads and writes to the shared container normally — only the extension's writes fail. This means resolved bundle identifiers can only be rendered in the extension's own SwiftUI view and cannot be c
Replies
4
Boosts
0
Views
235
Activity
Mar ’26
File Export from iOS - eventually import too
iOS 15 - iOS 26.x, SwiftUI, Xcode 26.1.1 (rewritten without links) I’m attempting to add the capability to export a file from CoreData. Since ShareLink requires iOS16+, I found an article showing how to create a UIKit wrapper for 'UIActivityViewController' This does work, but I end up with multiple files instead of one. How do I merge this into one file? Note: I don’t think I want to write to the app’s document directory – rather I’d like to allow the user to export to iCloud. Eventually, I’d like to share a list of dates with descriptions and if someone puts a sensitive date in there – I don’t want it to be left in a directory. I would include a warning that the file that they export needs to be handled with care if there are any sensitive dates. Some might consider birthdays as private information, right? I'd also like to be able to name the file - so far when the share sheet comes up, I select Save to Files and it uses a default name of text.txt My next step is to be able to import a CSV file (rou
Topic: UI Frameworks SubTopic: SwiftUI
Replies
6
Boosts
0
Views
356
Activity
Mar ’26
Access Screen Time total usage from main app when using DeviceActivityReportExtension
I am building a simple iOS app that shows the total phone usage time for today using the Screen Time APIs. Architecture: Main app → requests authorization using AuthorizationCenter.shared.requestAuthorization(for: .individual) → displays a DeviceActivityReport Report extension → DeviceActivityReportExtension → calculates total usage using DeviceActivityResults → shows the number in a SwiftUI view The report works correctly. The extension successfully calculates the total usage and displays it on screen. Example logic inside the report extension: for await activityData in data { for await segment in activityData.activitySegments { totalSeconds += segment.totalActivityDuration } } let totalMinutes = Int(totalSeconds / 60) The problem: I need the main app to access that number so I can store it daily in my own database. I tried to send the value from the extension to the main app using: App Group + UserDefaults(suiteName:) App Group + shared file (FileManager.containerURL) writing inside makeConfigurati
Replies
1
Boosts
0
Views
246
Activity
Mar ’26
Reply to NavigationTitle in LiquidGlass style
To achieve a LiquidGlass navigation title style in SwiftUI similar to what you see in macOS apps like Photos, you'll need to customize the appearance beyond what's available with standard SwiftUI modifiers. The LiquidGlass effect typically involves a semi-transparent, blurred background that reacts dynamically to the content beneath it. While SwiftUI doesn't directly support a LiquidGlass effect out of the box, you can create a custom view to mimic this behavior. Here's a basic approach to get you started: Custom LiquidGlass Navigation Title import` SwiftUI` struct LiquidGlassEffect: ViewModifier { var color: Color = .white var opacity: Double = 0.6 func body(content: Content) -> some View { content .background( GeometryReader { geometry in Color.clear .blur(radius: 10) .frame(width: geometry.size.width, height: geometry.size.height) .opacity(opacity) .blendMode(.destinationOver) .background(color.opacity(0.1)) } .edgesIgnoringSafeArea(.top) ) .overlay(
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26
RequestReview API does not trigger the review sheet in Xcode testing iPadOS 26.4 beta 3
Hello DTS team, the request review from StoreKit is not working in iOS 26.4 beta 3. I have filed a feedback (FB22157147). Sample code: import SwiftUI import StoreKit struct ContentView: View { @Environment(.requestReview) private var requestReview @State private var count = 0 var body: some View { VStack { Button(Increase Count) { count += 1 } Text(count, format: .number) .font(.largeTitle) } .onChange(of: count) { if count == 3 { Task { try await Task.sleep(for: .seconds(2)) requestReview() print(Request Review triggered!) // On iPadOS 26.4 beta 2 & 3, requestReview() does not trigger any review system sheet when testing in Xcode 26.3 // Works on iOS 26.3.1 } } } } }
Replies
0
Boosts
0
Views
218
Activity
Mar ’26
Reply to SwiftUI and undo
Undo and redo operations are implemented in SwiftUI TextEditors and TextFields by default. If you want to manage these actions: See UndoManager https://developer.apple.com/documentation/foundation/undomanager For your multi-platform app, SwiftUI has an environment value for that: .undoManager. https://developer.apple.com/documentation/swiftui/environmentvalues/undomanager Here's an example of .undoManager used to disable Undo. struct ContentView: View { @Environment(.undoManager) var undoManager: UndoManager? var body: some View { VStack { TextEditor(text: $text) } .task { undoManager?.disableUndoRegistration() } } } If you still have questions, feel free to provide more information here.  Travis
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Mar ’26
SwiftUI and undo
In my multiplatform SwiftUI document app, where should I implement undo? In the Views with Forms and Lists, Bindings, data classes or somewhere else? I am now implementing undo in Bindings and Lists, but I'm wondering if that's the right way to do it.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
169
Activity
Mar ’26
SwipeActions-triggered reorder animation briefly removes row and re-inserts it
I’m seeing a visual glitch in SwiftUI List on iOS 26 when row order changes after a swipeActions action. Setup: List + ForEach of items Items are sorted dynamically by isSelected (unselected first, selected last) Swipe action toggles isSelected Row should animate to new position Problem: On swipe select/unselect, the row sometimes appears to disappear briefly, then reappear in the new position Most visible when unselecting an item from the bottom selected group (it should move to top) Sometimes there is a temporary “empty gap” near the top during the move In some row styling setups, row corner masking also looks wrong during animation What I tried: Different animations (default, easeInOut, spring) Adding/removing small dispatch delay before state change Moving section header content outside List Using custom row backgrounds/corners vs system row styling Keeping stable IDs in ForEach Behavior still appears with native List + swipeActions on iOS 26. So my question is: Is this a known issue/regression w
Topic: UI Frameworks SubTopic: SwiftUI
Replies
0
Boosts
0
Views
119
Activity
Mar ’26
What is the lifecycle of onReceive subscriptions in SwiftUI views?
I'm trying to better understand how the onReceive modifier behaves in SwiftUI, specifically how its subscription lifecycle relates to view updates. Consider this example: TextField(Name, text: $name) .onReceive(Just(name)) { value in print(value) } This closure runs every time name changes. A common explanation is that SwiftUI recomputes body, which creates a new Just(name) publisher each time. However, this raises some questions for me about how onReceive actually works internally: When SwiftUI recomputes body, is the onReceive modifier recreated and resubscribed? Does SwiftUI automatically cancel the previous subscription when the view updates?
Replies
0
Boosts
0
Views
76
Activity
Mar ’26