I’m migrating old ObservableObjects to the new Observation method with @Observable macro. What happens if I don’t mark the previously unpublished properties with @ObservationIgnored?
- Would there be any meaningful performance/power penalties? Or any other complications like retaining references?
- What if there is no observer objects/views observing that property? Would there be any difference in performance between annotating the property with @ObservationIgnored and not annotating at all?
Example:
original class:
class Class1: ObservableObject {
@Published var a: Int = 1
var b: Int = 2
}
new class:
@Observable class Class2 {
var a: Int = 1
var b: Int = 2 // Do I absolutely need to use @ObservationIgnored here?
}
Thank you!
1