Here’s an attribute that can be applied to classes.
If I add a property to a class called MyClass
, for instance var string: String
, the compiler will complain that MyClass
has no accessible initializers. It won’t actually have an issue with you creating an initializer that doesn’t actually do anything to set the string,…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.