Skip to content

Name migration

Latest
Compare
Choose a tag to compare
@theblixguy theblixguy released this 02 Jul 17:20
· 1 commit to main since this release
1e53176

Unfortunately, the property wrapper needs to be renamed otherwise name lookup will treat a reference to Invalidating and other types as ambiguous in Xcode 13 due to conflicts with the same type name in UIKit/AppKit. I did not expect this behavior because I assumed the new types would be effectively unavailable on lower deployment targets and the compiler will allow me to shadow those types with mine, however that does not seem to be the case.

I have tried to isolate the changes to just the name of the property wrapper slightly (to ViewInvalidating), removing the Invalidations type from the UIView/NSView namespace and making it standalone and renaming UIViewInvalidating/NSViewInvalidating by adding a Type suffix to it.

These changes alone were enough to resolve the problems while still making it super easy to migrate to the new type names when the deployment target is changed to iOS 15+/tvOS 15+/macOS 12+. This is achieved by adding @available annotations and providing the new type names for the renamed argument. The renamed type name is then provided as a fix-it on the availability errors making it very easy for the user to migrate without manually needing to rename anything.