Apple's own Invalidating property wrapper example doesn't compile

24 Views Asked by At

In iOS 15, Apple introduced the @Invalidating property wrapper. The documentation shows an example:

enter image description here

class MyView: UIView {
    @Invalidating(.display) var badgeColor: UIColor
    
    @Invalidating(.display, .layout) var badgePosition: UIRectEdge
}

But that example doesn't compile, presumably because an initial value is needed for each property. Is this a bug in the way property wrappers work, or is it a mistake in the documentation?

0

There are 0 best solutions below