Provide views, controls, and layout structures for declaring your app's user interface using SwiftUI.

Posts under SwiftUI tag

200 Posts

Post

Replies

Boosts

Views

Activity

SF Symbols .replace animation is partially missing
In SF Symbols 7, I'm observing a discrepancy between the .replace animation previewed in the SF Symbols app and the result when using the code template the app provides. Expected behavior: When previewing the .replace animation in the SF Symbols app (with Magic Replace preferred), the transition looks like: Actual behavior: When I implement the animation using the exact code template generated by the SF Symbols app, the result looks like: My code: struct PlaygroundSwiftUIView: View { @State var name = "folder.circle" var body: some View { Image(systemName: name) .font(.system(size: 60)) .contentTransition(.symbolEffect(.replace)) .onTapGesture { name = "tree" } } } #Preview { PlaygroundSwiftUIView() } The animation rendered in my app does not match the preview shown in the SF Symbols app. The drawOff animation is partially missing. Is there something missing from the code template, or is there an additional configuration step required to achieve the correct Replace effect? or is this a bug?
0
0
7
29m
SF Symbols .replace animation is weird
In SF Symbols 7, I'm observing a discrepancy between the .replace animation previewed in the SF Symbols app and the result when using the code template the app provides. Expected behavior: When previewing the .replace animation in the SF Symbols app (with Magic Replace preferred), the transition looks like: Actual behavior: When I implement the animation using the exact code template generated by the SF Symbols app, the result looks like: My code: struct PlaygroundSwiftUIView: View { @State var name = "folder.circle" var body: some View { Image(systemName: name) .font(.system(size: 60)) .contentTransition(.symbolEffect(.replace)) .onTapGesture { name = "tree" } } } #Preview { PlaygroundSwiftUIView() } The animation rendered in my app does not match the preview shown in the SF Symbols app. The drawOff animation is partly missing. Is there something missing from the code template, or is there an additional configuration step required to achieve the correct Replace effect?
0
0
21
38m
Misleading error on ForEach
During refactoring of an app I made a typo which leads to a misleading error message in Xcode 26.4. I could reproduce it with a small sample code in Swift Playground. Is it a bug which should be reported? Details: I have an array containing two strings. Using a ForEach loop is fine: ForEach(appData.dataArray, id: \.self) { value in Text("\(value.subject)\t\(value.room)") } but with a typo in the Text line I got an error on the ForEach line: ForEach(appData.dataArray, id: \.self) { value in --> Cannot convert value of type '[MyArray]' to expected argument type 'Binding' Text("\(value.subject)\t\(value.subject.room)") } Complete sample code from Swift Playground (macOS 26): import SwiftUI class MyArray : Hashable, Equatable, Identifiable, ObservableObject, Codable { let id = UUID() @Published var subject: String @Published var room : String private enum CodingKeys : String, CodingKey { case subject case room } init(subject : String, room : String) { self.subject = subject self.room = room } func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(subject, forKey: .subject) try container.encode(room, forKey: .room) } required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) subject = try container.decode(String.self, forKey: .subject) room = try container.decode(String.self, forKey: .room) } static func == (v1: MyArray, v2: MyArray) -> Bool { let result = v1.id == v2.id return result } func hash(into hasher: inout Hasher) { hasher.combine(id) } } public class AppData : ObservableObject { @Published var dataArray : [MyArray] = [] init() { dataArray.append(MyArray(subject: "Foo", room: "Bar")) dataArray.append(MyArray(subject: "Foo", room: "Batz")) } } struct ContentView: View { @EnvironmentObject var appData : AppData var body: some View { ForEach(appData.dataArray, id: \.self) { value in Text("\(value.subject)\t\(value.subject.room)") // to fix the error replace value.subject.room with value.room } } } @main struct MyApp: App { var appData = AppData() var body: some Scene { WindowGroup { ContentView() .environmentObject(appData) } } }
0
0
32
1h
'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
Hi, Overview: I get the following error when trying to save / read from SwiftData It happens when I try to save color to SwiftData (code below) Error 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release Questions How can I resolve the error? I am not directly using data, I am using just Float values, swift types. Why am I getting this error? Is there a way to add a breakpoint to stop at the exact type causing the error? (Symbolic breakpoint doesn't seem to help) Or is the below code ok and not responsible for the error? Code import SwiftUI nonisolated struct ColorRepresentation: Codable { let red: Float let green: Float let blue: Float let opacity: Float init(colorResolved: Color.Resolved) { red = colorResolved.red green = colorResolved.green blue = colorResolved.blue opacity = colorResolved.opacity } func color() throws -> Color { Color( red: Double(red), green: Double(green), blue: Double(blue), opacity: Double(opacity) ) } } extension ColorRepresentation: Equatable {}
6
0
113
5h
SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
FB: FB22577211 The following trivial SwiftUI Text rendering causes wrong text layout and truncated text. The text should take the required height to render the text without truncation. Adding fixedSize does also not solve this. This bug only happens on devices and not on the simulator. Confirmed with iPhone 15 and iOS 26.4.1 but my colleague used another iPhone so it’s multiple iPhone devices. import SwiftUI let txt = """ Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition. """ struct ContentView: View { var body: some View { VStack { Text(txt) } .padding(.leading, 20) .padding(.trailing, 20) .frame(maxWidth: .infinity) } } This is also enough: Text(txt) .padding(.horizontal, 20) .fixedSize(horizontal: false, vertical: true) Expected: Text is rendered without truncation / ellipsis. Actual: Text is rendered with too small height / missing one line so it’s truncated / with ellipsis.
5
0
239
5h
Can contextMenu respect onLongPressGesture of a child element?
Hi, I have a list cell with a play button and a text label. When tapping the play button, it plays an audio, and when long-pressed, it plays the audio slowly. The long press works as per the example code below, but once a contextMenu is added, the long-press gesture of the play button is ignored (even though it's a small element in the cell), and the context menu is presented instead. Is there a way to allow for the context menu long-press to respect the long-press gesture of a child element in the cell on which it's defined? I also tried with highPriorityGesture but to no effect. Example code: HStack { Button { print("Play") } label: { Image(systemName: "play.circle") .onLongPressGesture(minimumDuration: 0.5) { print("Play slowly") } } Text("Audio cell") .frame(maxWidth: .infinity, alignment: .leading) } .contextMenu { Button("Hello") { print("hello") } Button("Goodbye") { print("goodbye") } }
0
0
68
1d
[iOS 26] iOS App Does Not Receive Deep Link from Widget When Using widgetAccentedRenderingMode on Image
Summary When a SwiftUI widget uses a Link containing an Image modified with .widgetAccentedRenderingMode (using any mode except .fullColor), tapping the image on the widget launches the app but does not pass the expected deep link URL to the SceneDelegate. Steps to Reproduce Create a SwiftUI Widget View with a Link: struct ImageView: View { var image: UIImage var body: some View { Link(URL(string: "myapp://image")!) { Image(uiImage: image) .resizable() .widgetAccentedRenderingMode(.accentedDesaturated) // or any mode other than .fullColor .scaledToFill() .clipped() } } } Add Custom URL Scheme in Info.plist: <dict> <key>CFBundleURLName</key> <string>com.company.myapp</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> Implement Deep Link Handling in SceneDelegate: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let url = connectionOptions.urlContexts.first?.url { handle(url) } } func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) { if let url = urlContexts.first?.url { handle(url) } } private func handle(_ url: URL) { // Process URL here } Run the application on a device or simulator. Add the widget to the Home Screen. Tap the image inside the widget. Expected Result The application launches and receives the URL in SceneDelegate, as expected. Actual Result The application launches, but the URL is not passed to SceneDelegate. Both connectionOptions.urlContexts and openURLContexts are empty.
3
1
506
2d
Previews for SwiftUI views in Packages don't work in Xcode 26.4
I have an iOS project based on SwiftUI in which almost all code is organised in Packages. With Xcode 26.2 and 26.3, I can preview all SwiftUI views without issues. With Xcode 26.4, the same previews don't work, in the canvas appears this error message: "Cannot preview in this file. Could not find target description for “TaskListView.swift”". The explanation is: "The list of source files that produce object files did not contain this file to be previewed. Check to make sure it is not excluded using the EXCLUDED_SOURCE_FILE_NAMES build setting." If I add a SwiftUI view to the main project files (not in a package), the preview works as expected. Is it an Xcode 26.4 regression? Or do I need to modify some configuration file?
6
0
316
3d
RealityView attachment draw order
My visionOS 26.3 app displays a diorama-like scene in a RealityView in a mixed immersive space, about 1 meter square, with view attachments floating above the scene. Each view attachment fades out after user interaction, by animating the view's opacity. What I'm observing is that depending on the position of a view attachment relative to the scene and the camera, an unwanted cutout effect is observed (presumably because of draw order issues), as shown in the right column in the screenshots below. YouTube video link of these sequences: https://youtu.be/oTuo0okKCkc (19 seconds) My question: How does visionOS determine the view attachment draw order relative to the RealityView scene? If I better understood how the draw order is determined, I could modify my scene to ensure that the view attachments were always drawn after the scene, fixing the unwanted cutout effect. I've successfully used ModelSortGroupComponent to control the draw order of entities within the RealityView scene, but my understanding is that this approach cannot be used with view attachments. I've submitted FB22014370 about this issue. Thank you.
4
0
1.4k
4d
How to detect if a binding is from a state or a constant?
Hi, I'm trying to create a custom TextField component where we can have our own custom FormatStyle as a param and then it will change the value binding according to the FormatStyle. It worked with State<Any?> like for example $textValue. But when I use .constant(2000) for instance, the Formatting doesn't work. So is there any way to detect whether the value param is constant or not? Thank you.
0
0
48
5d
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta)
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta) Summary In iOS 26 beta, using .navigationTitle() inside a NavigationStack fails to render the title when combined with a .toolbar and a List. The title initially appears as expected after launch, but disappears after a second state transition triggered by a button press. This regression does not occur in iOS 18. Steps to Reproduce Use the SwiftUI code sample below (see viewmodel and Reload button for state transitions). Run the app on an iOS 26 simulator (e.g., iPhone 16). On launch, the view starts in .loading state (shows a ProgressView). After 1 second, it transitions to .loaded and displays the title correctly. Tap the Reload button — this sets the state back to .loading, then switches it to .loaded again after 1 second. ❌ After this second transition to .loaded, the navigation title disappears and does not return. Actual Behavior The navigation title displays correctly after the initial launch transition from .loading → .loaded. However, after tapping the “Reload” button and transitioning .loading → .loaded a second time, the title no longer appears. This suggests a SwiftUI rendering/layout invalidation issue during state-driven view diffing involving .toolbar and List. Expected Behavior The navigation title “Loaded Data” should appear and remain visible every time the view is in .loaded state. ✅ GitHub Gist including Screen Recording 👉 View Gist with full details Sample Code import SwiftUI struct ContentView: View { private let vm = viewmodel() var body: some View { NavigationStack { VStack { switch vm.state { case .loading: ProgressView("Loading...") case .loaded: List { ItemList() } Button("Reload") { vm.state = .loading DispatchQueue.main.asyncAfter(deadline: .now() + 1) { vm.state = .loaded } } .navigationTitle("Loaded Data") } } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Menu { Text("hello") } label: { Image(systemName: "gearshape.fill") } } } } } } struct ItemList: View { var body: some View { Text("Item 1") Text("Item 2") Text("Item 3") } } @MainActor @Observable class viewmodel { enum State { case loading case loaded } var state: State = .loading init() { DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.state = .loaded } } }
3
1
383
5d
Navigation title scroll issue in iOS 26
Navigation title scroll along with the content in iOS 26. working fine in iOS 18 and below. One of my UI component is outside the scrollview which is causing the issue. var body: some View { VStack { Rectangle() .frame(maxWidth: .infinity) .frame(height: 60) .padding(.horizontal) .padding(.top) ScrollView { ForEach(0...5, id: \.self) { _ in RoundedRectangle(cornerRadius: 10) .fill(.green) .frame(maxWidth: .infinity) .frame(height: 100) .padding(.horizontal) } } } .navigationTitle("Hello World") } }
2
0
340
6d
Creating UTImportedTypeDeclarations entries yields duplicate Open menu entry
My iPadOS app can open .xml files. In my XMLApp.swift, I hooked up a: var body: some Scene { WindowGroup(id: "main") { .commands CommandGroup(replacing: .newItem) { ... Button(.openDot) { openXMLFile() } ... Next, I entered a new UTImportedTypeDeclarations / UTExportedTypeDeclarations in Project Settings -> Target -> Info -> Document Types, Exported Type Identifiers, Imported Type Identifiers, for the XML file-type: ... <key>UTImportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> <string>public.xml</string> <string>public.content</string> </array> ... As soon as I do that, Xcode creates an additional Open... menu entry all the way at the bottom of the File menu. I cannot get rid of this additional menu entry. Its state is disabled (grayed out). I have my own Open (per the code above), which also responds to ⌘ - O. My menu entry works fine, as long as I disable the same keyboard shortcut so they don't collide. The extra Open entry is also displayed on the matching iPadOS simulator. From the same codebase, the Open is not displayed on the Mac (targeting macOS, not Catalyst). On macOS, only my Open is in the File menu, as expected. Why is there a duplicate Open menu entry and how do I get rid of it?
0
0
136
1w
Toolbar Display Bug When Using Zoom NavigationTransition with Swipe-Back Gesture
Could anyone help confirm if this is a bug and suggest possible solutions? Thanksssss In iOS 18, when using Zoom NavigationTransition, the toolbar from the destination view may randomly appear on the source view after navigating back with the swipe-back gesture. Re-entering the destination view and navigating back again can temporarily resolve the issue, but it may still occur intermittently. This bug only happens with Zoom NavigationTransition and does not occur when using a button tap to navigate back. import SwiftUI struct test: View { @Namespace private var namespace var body: some View { NavigationStack { NavigationLink { Image("img1") .resizable() .navigationTransition(.zoom(sourceID: 1, in: namespace)) .toolbar { ToolbarItem(placement: .bottomBar) { Text("destination noDisappear") } } } label: { Image("img1") .resizable() .frame(width: 100, height: 100) .matchedTransitionSource(id: 1, in: namespace) .toolbar { ToolbarItem(placement: .bottomBar) { Text("source toolbar") } } } } } }
2
0
345
1w
View Navigation Title Disappears on watchOS Target When Built With Xcode 26+
I have a SwiftUI view in a watch companion app, and when I build my app with Xcode 26.2 or 26.3, the navigation title on a presented screen disappears after the watch screen goes dark. So, the navigation title is only visible when the screen is first presented and not again after the watch screen goes dark, for example when the user lowers their arm. Please see the screenshots for a better understanding. Notice that the "Bench Press" text is not visible in the third image. Also, I’ve confirmed that this does not happen when the app is built with Xcode 16.4. First Image (initial presentation of the screen): Second Image (watch screen goes dark): Third Image (watch screen goes back on, title missing): Although I've confirmed that this is related to Xcode versioning, and it happens on multiple screens, here is the redacted version of this SwiftUI view that is shown in the screenshots, in case it helps: var body: some View { NavigationStack(path: $viewModel.pushedViews) { TabView(selection: $selectedTab) { ... ZStack { List { ForEach(Array(viewModel.setModels.enumerated()), id: \.element) { index, setModel in VStack(spacing: 8.0) { SetContentView() } } ... } .listStyle(.plain) .buttonStyle(.plain) VStack { WatchRestTimerView(viewModel: viewModel.restTimerViewModel) Spacer() } } .tag(WatchExerciseLoggingTab.logExercise) // HERE IS THE TITLE SET .navigationTitle(viewModel.name) NowPlayingView().tag(WatchExerciseLoggingTab.nowPlaying) } .tabViewStyle(PageTabViewStyle()) .navigationDestination(for: WatchWeightAndSetExerciseSummaryPushedView.self, destination: { _ in RedactedView() }) } } This prevents me from migrating to Xcode 26, I would also appreciate if anyone has a work around until there is a fix for this, I mean I can stop using navigation title and add a Text at the top but it is not quite the same UI experience we get from the navigation title in a watch app.
0
0
36
1w
Embedded Collection View in SwiftUI offset issue
I have a collection view that covers all the screen and it is scrolling behavior is paging. This collection view is embedded in a UIViewRepresentable and used in a SwiftUI app. The issue is that when users rotate the devices, sometimes the CollectionView.contentOffset get miscalculated and shows 2 pages. This is the code that I'm using for the collectionView and collectionViewLayout: class PageFlowLayout: UICollectionViewFlowLayout { override class var layoutAttributesClass: AnyClass { UICollectionViewLayoutAttributes.self } private var calculatedAttributes: [UICollectionViewLayoutAttributes] = [] private var calculatedContentWidth: CGFloat = 0 private var calculatedContentHeight: CGFloat = 0 public weak var delegate: PageFlowLayoutDelegate? override var collectionViewContentSize: CGSize { return CGSize(width: self.calculatedContentWidth, height: self.calculatedContentHeight) } override init() { super.init() self.estimatedItemSize = .zero self.scrollDirection = .horizontal self.minimumLineSpacing = 0 self.minimumInteritemSpacing = 0 self.sectionInset = .zero } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func prepare() { guard let collectionView = collectionView, collectionView.numberOfSections > 0, calculatedAttributes.isEmpty else { return } estimatedItemSize = collectionView.bounds.size for item in 0..<collectionView.numberOfItems(inSection: 0) { let indexPath = IndexPath(item: item, section: 0) let attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath) let itemOrigin = CGPoint(x: CGFloat(item) * collectionView.frame.width, y: 0) attributes.frame = .init(origin: itemOrigin, size: collectionView.frame.size) calculatedAttributes.append(attributes) } calculatedContentWidth = collectionView.bounds.width * CGFloat(calculatedAttributes.count) calculatedContentHeight = collectionView.bounds.size.height } override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { return calculatedAttributes.compactMap { return $0.frame.intersects(rect) ? $0 : nil } } override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { return calculatedAttributes[indexPath.item] } override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { guard let collectionView else { return false } if newBounds.size != collectionView.bounds.size { return true } if newBounds.size.width > 0 { let pages = calculatedContentWidth / newBounds.size.width // If the contentWidth matches the number of pages, // if not it requires to layout the cells let arePagesExact = pages.truncatingRemainder(dividingBy: 1) == 0 return !arePagesExact } return false } override func invalidateLayout() { calculatedAttributes = [] super.invalidateLayout() } override func shouldInvalidateLayout(forPreferredLayoutAttributes preferredAttributes: UICollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: UICollectionViewLayoutAttributes) -> Bool { guard let collectionView, #available(iOS 18.0, *) else { return false } return preferredAttributes.size != collectionView.bounds.size } override func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext) { guard let customContext = context as? UICollectionViewFlowLayoutInvalidationContext else { return } if let collectionView, let currentPage = delegate?.currentPage() { let delta = (CGFloat(currentPage) * collectionView.bounds.width) - collectionView.contentOffset.x customContext.contentOffsetAdjustment.x += delta } calculatedAttributes = [] super.invalidateLayout(with: customContext) } override func prepare(forAnimatedBoundsChange oldBounds: CGRect) { super.prepare(forAnimatedBoundsChange: oldBounds) guard let collectionView else { return } if oldBounds.width != collectionView.bounds.width { invalidateLayout() } } override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint { guard let collectionView, let currentPage = delegate?.currentPage() else { return .zero } let targetContentOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset) let targetPage = targetContentOffset.x / collectionView.frame.width if targetPage != CGFloat(currentPage) { let xPosition = CGFloat(currentPage) * collectionView.frame.width return CGPoint(x: xPosition, y: 0) } return targetContentOffset } // This function updates the contentOffset in case is wrong override func finalizeCollectionViewUpdates() { guard let collectionView, let currentPage = delegate?.currentPage() else { return } let xPosition = CGFloat(currentPage) * collectionView.bounds.width if xPosition != collectionView.contentOffset.x { let offset = CGPoint(x: xPosition, y: 0) collectionView.setContentOffset(offset, animated: false) } } } The full implementation is attached in the .txt file: RotationTestView.txt
6
0
167
1w
TabView's Tab Label Image symbolEffect not allowed?
Hi, I'm using a TabView and for a given case I wish to have the icon of the Tab animated by symbolEffect to signify a state. The symbolEffect however doesn't seem to have an effect when used on a tab's label image. Is it really not possible? Tab(value: .hello) { EmptyView() } label: { Image(systemName: "hand.wave.fill") .symbolEffect(.wiggle, options: .repeating) } I still wish to use the TabView because it's amazing.
2
0
90
1w
fullScreenCover & Sheet modifier lifecycles
Hello everyone, I’m running into an issue where a partial sheet repeatedly presents and dismisses in a loop. Setup The main screen is presented using fullScreenCover From that screen, a button triggers a standard partial-height sheet The sheet is presented using .sheet(item:) Expected Behavior Tapping the button should present the sheet once and allow it to be dismissed normally. Actual Behavior After the sheet is triggered, it continuously presents and dismisses. What I’ve Verified The bound item is not being reassigned in either the parent or the presented view There is no .task, .onAppear, or .onChange that sets the item again The loop appears to happen without any explicit state updates Additional Context I encountered a very similar issue when iOS 26.0 was first released At that time, moving the .sheet modifier to a higher parent level resolved the issue The problem has now returned on iOS 26.4 beta I’m currently unable to reproduce this in a minimal sample project, which makes it unclear whether: this is a framework regression, or I’m missing a new presentation requirement Environment iOS: 26.4 beta Xcode: 26.4 beta I’ve attached a screen recording of the behavior. Has anyone else experienced this with a fullScreenCover → sheet flow on iOS 26.4? Any guidance or confirmation would be greatly appreciated. Thank you!
3
0
281
1w
SF Symbols .replace animation is partially missing
In SF Symbols 7, I'm observing a discrepancy between the .replace animation previewed in the SF Symbols app and the result when using the code template the app provides. Expected behavior: When previewing the .replace animation in the SF Symbols app (with Magic Replace preferred), the transition looks like: Actual behavior: When I implement the animation using the exact code template generated by the SF Symbols app, the result looks like: My code: struct PlaygroundSwiftUIView: View { @State var name = "folder.circle" var body: some View { Image(systemName: name) .font(.system(size: 60)) .contentTransition(.symbolEffect(.replace)) .onTapGesture { name = "tree" } } } #Preview { PlaygroundSwiftUIView() } The animation rendered in my app does not match the preview shown in the SF Symbols app. The drawOff animation is partially missing. Is there something missing from the code template, or is there an additional configuration step required to achieve the correct Replace effect? or is this a bug?
Replies
0
Boosts
0
Views
7
Activity
29m
SF Symbols .replace animation is weird
In SF Symbols 7, I'm observing a discrepancy between the .replace animation previewed in the SF Symbols app and the result when using the code template the app provides. Expected behavior: When previewing the .replace animation in the SF Symbols app (with Magic Replace preferred), the transition looks like: Actual behavior: When I implement the animation using the exact code template generated by the SF Symbols app, the result looks like: My code: struct PlaygroundSwiftUIView: View { @State var name = "folder.circle" var body: some View { Image(systemName: name) .font(.system(size: 60)) .contentTransition(.symbolEffect(.replace)) .onTapGesture { name = "tree" } } } #Preview { PlaygroundSwiftUIView() } The animation rendered in my app does not match the preview shown in the SF Symbols app. The drawOff animation is partly missing. Is there something missing from the code template, or is there an additional configuration step required to achieve the correct Replace effect?
Replies
0
Boosts
0
Views
21
Activity
38m
Misleading error on ForEach
During refactoring of an app I made a typo which leads to a misleading error message in Xcode 26.4. I could reproduce it with a small sample code in Swift Playground. Is it a bug which should be reported? Details: I have an array containing two strings. Using a ForEach loop is fine: ForEach(appData.dataArray, id: \.self) { value in Text("\(value.subject)\t\(value.room)") } but with a typo in the Text line I got an error on the ForEach line: ForEach(appData.dataArray, id: \.self) { value in --> Cannot convert value of type '[MyArray]' to expected argument type 'Binding' Text("\(value.subject)\t\(value.subject.room)") } Complete sample code from Swift Playground (macOS 26): import SwiftUI class MyArray : Hashable, Equatable, Identifiable, ObservableObject, Codable { let id = UUID() @Published var subject: String @Published var room : String private enum CodingKeys : String, CodingKey { case subject case room } init(subject : String, room : String) { self.subject = subject self.room = room } func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(subject, forKey: .subject) try container.encode(room, forKey: .room) } required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) subject = try container.decode(String.self, forKey: .subject) room = try container.decode(String.self, forKey: .room) } static func == (v1: MyArray, v2: MyArray) -> Bool { let result = v1.id == v2.id return result } func hash(into hasher: inout Hasher) { hasher.combine(id) } } public class AppData : ObservableObject { @Published var dataArray : [MyArray] = [] init() { dataArray.append(MyArray(subject: "Foo", room: "Bar")) dataArray.append(MyArray(subject: "Foo", room: "Batz")) } } struct ContentView: View { @EnvironmentObject var appData : AppData var body: some View { ForEach(appData.dataArray, id: \.self) { value in Text("\(value.subject)\t\(value.subject.room)") // to fix the error replace value.subject.room with value.room } } } @main struct MyApp: App { var appData = AppData() var body: some Scene { WindowGroup { ContentView() .environmentObject(appData) } } }
Replies
0
Boosts
0
Views
32
Activity
1h
'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
Hi, Overview: I get the following error when trying to save / read from SwiftData It happens when I try to save color to SwiftData (code below) Error 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release Questions How can I resolve the error? I am not directly using data, I am using just Float values, swift types. Why am I getting this error? Is there a way to add a breakpoint to stop at the exact type causing the error? (Symbolic breakpoint doesn't seem to help) Or is the below code ok and not responsible for the error? Code import SwiftUI nonisolated struct ColorRepresentation: Codable { let red: Float let green: Float let blue: Float let opacity: Float init(colorResolved: Color.Resolved) { red = colorResolved.red green = colorResolved.green blue = colorResolved.blue opacity = colorResolved.opacity } func color() throws -> Color { Color( red: Double(red), green: Double(green), blue: Double(blue), opacity: Double(opacity) ) } } extension ColorRepresentation: Equatable {}
Replies
6
Boosts
0
Views
113
Activity
5h
SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
FB: FB22577211 The following trivial SwiftUI Text rendering causes wrong text layout and truncated text. The text should take the required height to render the text without truncation. Adding fixedSize does also not solve this. This bug only happens on devices and not on the simulator. Confirmed with iPhone 15 and iOS 26.4.1 but my colleague used another iPhone so it’s multiple iPhone devices. import SwiftUI let txt = """ Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition. """ struct ContentView: View { var body: some View { VStack { Text(txt) } .padding(.leading, 20) .padding(.trailing, 20) .frame(maxWidth: .infinity) } } This is also enough: Text(txt) .padding(.horizontal, 20) .fixedSize(horizontal: false, vertical: true) Expected: Text is rendered without truncation / ellipsis. Actual: Text is rendered with too small height / missing one line so it’s truncated / with ellipsis.
Replies
5
Boosts
0
Views
239
Activity
5h
Can contextMenu respect onLongPressGesture of a child element?
Hi, I have a list cell with a play button and a text label. When tapping the play button, it plays an audio, and when long-pressed, it plays the audio slowly. The long press works as per the example code below, but once a contextMenu is added, the long-press gesture of the play button is ignored (even though it's a small element in the cell), and the context menu is presented instead. Is there a way to allow for the context menu long-press to respect the long-press gesture of a child element in the cell on which it's defined? I also tried with highPriorityGesture but to no effect. Example code: HStack { Button { print("Play") } label: { Image(systemName: "play.circle") .onLongPressGesture(minimumDuration: 0.5) { print("Play slowly") } } Text("Audio cell") .frame(maxWidth: .infinity, alignment: .leading) } .contextMenu { Button("Hello") { print("hello") } Button("Goodbye") { print("goodbye") } }
Replies
0
Boosts
0
Views
68
Activity
1d
[iOS 26] iOS App Does Not Receive Deep Link from Widget When Using widgetAccentedRenderingMode on Image
Summary When a SwiftUI widget uses a Link containing an Image modified with .widgetAccentedRenderingMode (using any mode except .fullColor), tapping the image on the widget launches the app but does not pass the expected deep link URL to the SceneDelegate. Steps to Reproduce Create a SwiftUI Widget View with a Link: struct ImageView: View { var image: UIImage var body: some View { Link(URL(string: "myapp://image")!) { Image(uiImage: image) .resizable() .widgetAccentedRenderingMode(.accentedDesaturated) // or any mode other than .fullColor .scaledToFill() .clipped() } } } Add Custom URL Scheme in Info.plist: <dict> <key>CFBundleURLName</key> <string>com.company.myapp</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> Implement Deep Link Handling in SceneDelegate: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let url = connectionOptions.urlContexts.first?.url { handle(url) } } func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) { if let url = urlContexts.first?.url { handle(url) } } private func handle(_ url: URL) { // Process URL here } Run the application on a device or simulator. Add the widget to the Home Screen. Tap the image inside the widget. Expected Result The application launches and receives the URL in SceneDelegate, as expected. Actual Result The application launches, but the URL is not passed to SceneDelegate. Both connectionOptions.urlContexts and openURLContexts are empty.
Replies
3
Boosts
1
Views
506
Activity
2d
Add a DancingCreatures view
I'm almost having a heart attack with this "a DancingCreatures view" issue. I must be really dumb I've tried everything and the question just won't move forward. Someone, for the love of God, explain to me what it would be.
Replies
0
Boosts
0
Views
324
Activity
3d
Previews for SwiftUI views in Packages don't work in Xcode 26.4
I have an iOS project based on SwiftUI in which almost all code is organised in Packages. With Xcode 26.2 and 26.3, I can preview all SwiftUI views without issues. With Xcode 26.4, the same previews don't work, in the canvas appears this error message: "Cannot preview in this file. Could not find target description for “TaskListView.swift”". The explanation is: "The list of source files that produce object files did not contain this file to be previewed. Check to make sure it is not excluded using the EXCLUDED_SOURCE_FILE_NAMES build setting." If I add a SwiftUI view to the main project files (not in a package), the preview works as expected. Is it an Xcode 26.4 regression? Or do I need to modify some configuration file?
Replies
6
Boosts
0
Views
316
Activity
3d
RealityView attachment draw order
My visionOS 26.3 app displays a diorama-like scene in a RealityView in a mixed immersive space, about 1 meter square, with view attachments floating above the scene. Each view attachment fades out after user interaction, by animating the view's opacity. What I'm observing is that depending on the position of a view attachment relative to the scene and the camera, an unwanted cutout effect is observed (presumably because of draw order issues), as shown in the right column in the screenshots below. YouTube video link of these sequences: https://youtu.be/oTuo0okKCkc (19 seconds) My question: How does visionOS determine the view attachment draw order relative to the RealityView scene? If I better understood how the draw order is determined, I could modify my scene to ensure that the view attachments were always drawn after the scene, fixing the unwanted cutout effect. I've successfully used ModelSortGroupComponent to control the draw order of entities within the RealityView scene, but my understanding is that this approach cannot be used with view attachments. I've submitted FB22014370 about this issue. Thank you.
Replies
4
Boosts
0
Views
1.4k
Activity
4d
How to detect if a binding is from a state or a constant?
Hi, I'm trying to create a custom TextField component where we can have our own custom FormatStyle as a param and then it will change the value binding according to the FormatStyle. It worked with State<Any?> like for example $textValue. But when I use .constant(2000) for instance, the Formatting doesn't work. So is there any way to detect whether the value param is constant or not? Thank you.
Replies
0
Boosts
0
Views
48
Activity
5d
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta)
.navigationTitle disappears when using .toolbar and List inside NavigationStack (iOS 26 beta) Summary In iOS 26 beta, using .navigationTitle() inside a NavigationStack fails to render the title when combined with a .toolbar and a List. The title initially appears as expected after launch, but disappears after a second state transition triggered by a button press. This regression does not occur in iOS 18. Steps to Reproduce Use the SwiftUI code sample below (see viewmodel and Reload button for state transitions). Run the app on an iOS 26 simulator (e.g., iPhone 16). On launch, the view starts in .loading state (shows a ProgressView). After 1 second, it transitions to .loaded and displays the title correctly. Tap the Reload button — this sets the state back to .loading, then switches it to .loaded again after 1 second. ❌ After this second transition to .loaded, the navigation title disappears and does not return. Actual Behavior The navigation title displays correctly after the initial launch transition from .loading → .loaded. However, after tapping the “Reload” button and transitioning .loading → .loaded a second time, the title no longer appears. This suggests a SwiftUI rendering/layout invalidation issue during state-driven view diffing involving .toolbar and List. Expected Behavior The navigation title “Loaded Data” should appear and remain visible every time the view is in .loaded state. ✅ GitHub Gist including Screen Recording 👉 View Gist with full details Sample Code import SwiftUI struct ContentView: View { private let vm = viewmodel() var body: some View { NavigationStack { VStack { switch vm.state { case .loading: ProgressView("Loading...") case .loaded: List { ItemList() } Button("Reload") { vm.state = .loading DispatchQueue.main.asyncAfter(deadline: .now() + 1) { vm.state = .loaded } } .navigationTitle("Loaded Data") } } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Menu { Text("hello") } label: { Image(systemName: "gearshape.fill") } } } } } } struct ItemList: View { var body: some View { Text("Item 1") Text("Item 2") Text("Item 3") } } @MainActor @Observable class viewmodel { enum State { case loading case loaded } var state: State = .loading init() { DispatchQueue.main.asyncAfter(deadline: .now() + 1) { self.state = .loaded } } }
Replies
3
Boosts
1
Views
383
Activity
5d
Navigation title scroll issue in iOS 26
Navigation title scroll along with the content in iOS 26. working fine in iOS 18 and below. One of my UI component is outside the scrollview which is causing the issue. var body: some View { VStack { Rectangle() .frame(maxWidth: .infinity) .frame(height: 60) .padding(.horizontal) .padding(.top) ScrollView { ForEach(0...5, id: \.self) { _ in RoundedRectangle(cornerRadius: 10) .fill(.green) .frame(maxWidth: .infinity) .frame(height: 100) .padding(.horizontal) } } } .navigationTitle("Hello World") } }
Replies
2
Boosts
0
Views
340
Activity
6d
Creating UTImportedTypeDeclarations entries yields duplicate Open menu entry
My iPadOS app can open .xml files. In my XMLApp.swift, I hooked up a: var body: some Scene { WindowGroup(id: "main") { .commands CommandGroup(replacing: .newItem) { ... Button(.openDot) { openXMLFile() } ... Next, I entered a new UTImportedTypeDeclarations / UTExportedTypeDeclarations in Project Settings -> Target -> Info -> Document Types, Exported Type Identifiers, Imported Type Identifiers, for the XML file-type: ... <key>UTImportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> <string>public.xml</string> <string>public.content</string> </array> ... As soon as I do that, Xcode creates an additional Open... menu entry all the way at the bottom of the File menu. I cannot get rid of this additional menu entry. Its state is disabled (grayed out). I have my own Open (per the code above), which also responds to ⌘ - O. My menu entry works fine, as long as I disable the same keyboard shortcut so they don't collide. The extra Open entry is also displayed on the matching iPadOS simulator. From the same codebase, the Open is not displayed on the Mac (targeting macOS, not Catalyst). On macOS, only my Open is in the File menu, as expected. Why is there a duplicate Open menu entry and how do I get rid of it?
Replies
0
Boosts
0
Views
136
Activity
1w
Toolbar Display Bug When Using Zoom NavigationTransition with Swipe-Back Gesture
Could anyone help confirm if this is a bug and suggest possible solutions? Thanksssss In iOS 18, when using Zoom NavigationTransition, the toolbar from the destination view may randomly appear on the source view after navigating back with the swipe-back gesture. Re-entering the destination view and navigating back again can temporarily resolve the issue, but it may still occur intermittently. This bug only happens with Zoom NavigationTransition and does not occur when using a button tap to navigate back. import SwiftUI struct test: View { @Namespace private var namespace var body: some View { NavigationStack { NavigationLink { Image("img1") .resizable() .navigationTransition(.zoom(sourceID: 1, in: namespace)) .toolbar { ToolbarItem(placement: .bottomBar) { Text("destination noDisappear") } } } label: { Image("img1") .resizable() .frame(width: 100, height: 100) .matchedTransitionSource(id: 1, in: namespace) .toolbar { ToolbarItem(placement: .bottomBar) { Text("source toolbar") } } } } } }
Replies
2
Boosts
0
Views
345
Activity
1w
Why is the .opacity AnyTransition is marked as nonisolated(unsafe)
Because of this, in Swift 6 mode, Xcode complains about the access, and ask me to use unsafe keyword. To fix it, I need to do this: Anyone can explain this abrupt nonisolated(unsafe) change?
Replies
1
Boosts
0
Views
104
Activity
1w
View Navigation Title Disappears on watchOS Target When Built With Xcode 26+
I have a SwiftUI view in a watch companion app, and when I build my app with Xcode 26.2 or 26.3, the navigation title on a presented screen disappears after the watch screen goes dark. So, the navigation title is only visible when the screen is first presented and not again after the watch screen goes dark, for example when the user lowers their arm. Please see the screenshots for a better understanding. Notice that the "Bench Press" text is not visible in the third image. Also, I’ve confirmed that this does not happen when the app is built with Xcode 16.4. First Image (initial presentation of the screen): Second Image (watch screen goes dark): Third Image (watch screen goes back on, title missing): Although I've confirmed that this is related to Xcode versioning, and it happens on multiple screens, here is the redacted version of this SwiftUI view that is shown in the screenshots, in case it helps: var body: some View { NavigationStack(path: $viewModel.pushedViews) { TabView(selection: $selectedTab) { ... ZStack { List { ForEach(Array(viewModel.setModels.enumerated()), id: \.element) { index, setModel in VStack(spacing: 8.0) { SetContentView() } } ... } .listStyle(.plain) .buttonStyle(.plain) VStack { WatchRestTimerView(viewModel: viewModel.restTimerViewModel) Spacer() } } .tag(WatchExerciseLoggingTab.logExercise) // HERE IS THE TITLE SET .navigationTitle(viewModel.name) NowPlayingView().tag(WatchExerciseLoggingTab.nowPlaying) } .tabViewStyle(PageTabViewStyle()) .navigationDestination(for: WatchWeightAndSetExerciseSummaryPushedView.self, destination: { _ in RedactedView() }) } } This prevents me from migrating to Xcode 26, I would also appreciate if anyone has a work around until there is a fix for this, I mean I can stop using navigation title and add a Text at the top but it is not quite the same UI experience we get from the navigation title in a watch app.
Replies
0
Boosts
0
Views
36
Activity
1w
Embedded Collection View in SwiftUI offset issue
I have a collection view that covers all the screen and it is scrolling behavior is paging. This collection view is embedded in a UIViewRepresentable and used in a SwiftUI app. The issue is that when users rotate the devices, sometimes the CollectionView.contentOffset get miscalculated and shows 2 pages. This is the code that I'm using for the collectionView and collectionViewLayout: class PageFlowLayout: UICollectionViewFlowLayout { override class var layoutAttributesClass: AnyClass { UICollectionViewLayoutAttributes.self } private var calculatedAttributes: [UICollectionViewLayoutAttributes] = [] private var calculatedContentWidth: CGFloat = 0 private var calculatedContentHeight: CGFloat = 0 public weak var delegate: PageFlowLayoutDelegate? override var collectionViewContentSize: CGSize { return CGSize(width: self.calculatedContentWidth, height: self.calculatedContentHeight) } override init() { super.init() self.estimatedItemSize = .zero self.scrollDirection = .horizontal self.minimumLineSpacing = 0 self.minimumInteritemSpacing = 0 self.sectionInset = .zero } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func prepare() { guard let collectionView = collectionView, collectionView.numberOfSections > 0, calculatedAttributes.isEmpty else { return } estimatedItemSize = collectionView.bounds.size for item in 0..<collectionView.numberOfItems(inSection: 0) { let indexPath = IndexPath(item: item, section: 0) let attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath) let itemOrigin = CGPoint(x: CGFloat(item) * collectionView.frame.width, y: 0) attributes.frame = .init(origin: itemOrigin, size: collectionView.frame.size) calculatedAttributes.append(attributes) } calculatedContentWidth = collectionView.bounds.width * CGFloat(calculatedAttributes.count) calculatedContentHeight = collectionView.bounds.size.height } override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { return calculatedAttributes.compactMap { return $0.frame.intersects(rect) ? $0 : nil } } override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { return calculatedAttributes[indexPath.item] } override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { guard let collectionView else { return false } if newBounds.size != collectionView.bounds.size { return true } if newBounds.size.width > 0 { let pages = calculatedContentWidth / newBounds.size.width // If the contentWidth matches the number of pages, // if not it requires to layout the cells let arePagesExact = pages.truncatingRemainder(dividingBy: 1) == 0 return !arePagesExact } return false } override func invalidateLayout() { calculatedAttributes = [] super.invalidateLayout() } override func shouldInvalidateLayout(forPreferredLayoutAttributes preferredAttributes: UICollectionViewLayoutAttributes, withOriginalAttributes originalAttributes: UICollectionViewLayoutAttributes) -> Bool { guard let collectionView, #available(iOS 18.0, *) else { return false } return preferredAttributes.size != collectionView.bounds.size } override func invalidateLayout(with context: UICollectionViewLayoutInvalidationContext) { guard let customContext = context as? UICollectionViewFlowLayoutInvalidationContext else { return } if let collectionView, let currentPage = delegate?.currentPage() { let delta = (CGFloat(currentPage) * collectionView.bounds.width) - collectionView.contentOffset.x customContext.contentOffsetAdjustment.x += delta } calculatedAttributes = [] super.invalidateLayout(with: customContext) } override func prepare(forAnimatedBoundsChange oldBounds: CGRect) { super.prepare(forAnimatedBoundsChange: oldBounds) guard let collectionView else { return } if oldBounds.width != collectionView.bounds.width { invalidateLayout() } } override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint { guard let collectionView, let currentPage = delegate?.currentPage() else { return .zero } let targetContentOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset) let targetPage = targetContentOffset.x / collectionView.frame.width if targetPage != CGFloat(currentPage) { let xPosition = CGFloat(currentPage) * collectionView.frame.width return CGPoint(x: xPosition, y: 0) } return targetContentOffset } // This function updates the contentOffset in case is wrong override func finalizeCollectionViewUpdates() { guard let collectionView, let currentPage = delegate?.currentPage() else { return } let xPosition = CGFloat(currentPage) * collectionView.bounds.width if xPosition != collectionView.contentOffset.x { let offset = CGPoint(x: xPosition, y: 0) collectionView.setContentOffset(offset, animated: false) } } } The full implementation is attached in the .txt file: RotationTestView.txt
Replies
6
Boosts
0
Views
167
Activity
1w
TabView's Tab Label Image symbolEffect not allowed?
Hi, I'm using a TabView and for a given case I wish to have the icon of the Tab animated by symbolEffect to signify a state. The symbolEffect however doesn't seem to have an effect when used on a tab's label image. Is it really not possible? Tab(value: .hello) { EmptyView() } label: { Image(systemName: "hand.wave.fill") .symbolEffect(.wiggle, options: .repeating) } I still wish to use the TabView because it's amazing.
Replies
2
Boosts
0
Views
90
Activity
1w
fullScreenCover & Sheet modifier lifecycles
Hello everyone, I’m running into an issue where a partial sheet repeatedly presents and dismisses in a loop. Setup The main screen is presented using fullScreenCover From that screen, a button triggers a standard partial-height sheet The sheet is presented using .sheet(item:) Expected Behavior Tapping the button should present the sheet once and allow it to be dismissed normally. Actual Behavior After the sheet is triggered, it continuously presents and dismisses. What I’ve Verified The bound item is not being reassigned in either the parent or the presented view There is no .task, .onAppear, or .onChange that sets the item again The loop appears to happen without any explicit state updates Additional Context I encountered a very similar issue when iOS 26.0 was first released At that time, moving the .sheet modifier to a higher parent level resolved the issue The problem has now returned on iOS 26.4 beta I’m currently unable to reproduce this in a minimal sample project, which makes it unclear whether: this is a framework regression, or I’m missing a new presentation requirement Environment iOS: 26.4 beta Xcode: 26.4 beta I’ve attached a screen recording of the behavior. Has anyone else experienced this with a fullScreenCover → sheet flow on iOS 26.4? Any guidance or confirmation would be greatly appreciated. Thank you!
Replies
3
Boosts
0
Views
281
Activity
1w