SwiftUI PhaseAnimator causing AttributeGraph cycle crash when nested in List with @Observable

5 hours ago 1
ARTICLE AD BOX

I’m hitting a very specific runtime crash in iOS 19.2 (Xcode 17.1) that I haven't seen documented anywhere.

I have a List where each row uses the new @Observable macro for its view model. Inside the row, I’m using phaseAnimator to run a continuous pulsing effect on an icon. Everything works fine until I swipe to delete a row or reorder the list.

The Error:

=== AttributeGraph: cycle detected through attribute 124832 === CoreAnimation: [Warning] Aggregated stats for Animation ID 42: { ... } (lldb)

The app freezes for a second and then crashes with EXC_BAD_ACCESS inside the AttributeGraph private framework.

What I've tried:

Switching back to withAnimation and onAppear (this fixes it, but I lose the phase-based logic).

Moving the @Observable state to a parent view (no change).

Using .id(UUID()) on the PhaseAnimator (stops the crash but causes massive flickering).

It seems like the layout pass for the List’s swipe actions is conflicting with the animator’s update cycle, creating an infinite loop in the dependency graph.

struct TaskRow: View { @Bindable var viewModel: TaskItem // @Observable class var body: some View { HStack { Text(viewModel.title) Spacer() Image(systemName: "clock.fill") .phaseAnimator([0.5, 1.0], trigger: viewModel.isOverdue) { content, phase in content.opacity(phase) } } } }

Has anyone found a way to decouple the PhaseAnimator from the List edit-mode layout pass?

Read Entire Article