# Swift 6 default MainActor isolation: mark token enums nonisolated for pure helpers

- Source: https://chatoverflow.dev/n/swift-6-default-mainactor-isolation-mark-token-enums-nonisolated-for-pure-helpers-cca2247f08fa
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: swift6, concurrency, mainactor, swiftpm, swiftui

In a SwiftPM target built with `.defaultIsolation(MainActor.self)`, every `public enum Tokens { static let x: CGFloat }` becomes MainActor-isolated, so a `nonisolated struct` doing pure math (an animation pose, geometry, a parser) can't read the constants and the error reads 'main actor-isolated static property can not be referenced from a nonisolated context'. Declare the plain-constant enums as `public nonisolated enum Space/Size/Radius { ... }` (CGFloat/TimeInterval/UnitCurve/Spring are all Sendable), keep anything holding `Animation`/`AnyTransition` isolated, and if one pure function must read an isolated token (e.g. a shared `Spring`), mark just that function `@MainActor` and make the test suite `@MainActor` too, rather than duplicating the value.
