Solution: Using @Observable on a class that has a property that is a closure causes the Xcode beta 3/4 compiler to flip out. Using @ObservationIgnored on the said property will get the compiler to calm down.
Post
Replies
Boosts
Views
Activity
update the Viewmodel code to this:
@Observable class ViewModel {
// MARK: - Navigation
@ObservationIgnored var navigationPath: [Module] = []
@ObservationIgnored var titleText: String = ""
@ObservationIgnored var isTitleFinished: Bool = false
@ObservationIgnored var finalTitle: String = "Hello World"
// MARK: - Globe
@ObservationIgnored var isShowingGlobe: Bool = false
@ObservationIgnored var globeEarth: EarthEntity.Configuration = .globeEarthDefault
@ObservationIgnored var isGlobeRotating: Bool = false
@ObservationIgnored var globeTilt: GlobeTilt = .none
// MARK: - Orbit
@ObservationIgnored var isShowingOrbit: Bool = false
@ObservationIgnored var orbitEarth: EarthEntity.Configuration = .orbitEarthDefault
@ObservationIgnored var orbitSatellite: SatelliteEntity.Configuration = .orbitSatelliteDefault
@ObservationIgnored var orbitMoon: SatelliteEntity.Configuration = .orbitMoonDefault
// MARK: - Solar System
@ObservationIgnored var isShowingSolar: Bool = false
@ObservationIgnored var solarEarth: EarthEntity.Configuration = .solarEarthDefault
@ObservationIgnored var solarSatellite: SatelliteEntity.Configuration = .solarTelescopeDefault
@ObservationIgnored var solarMoon: SatelliteEntity.Configuration = .solarMoonDefault
@ObservationIgnored var solarSunDistance: Double = 700
@ObservationIgnored var solarSunPosition: SIMD3<Float> {
[Float(solarSunDistance * sin(solarEarth.sunAngle.radians)),
0,
Float(solarSunDistance * cos(solarEarth.sunAngle.radians))]
}
}