Serena
(Serena)
1
Update: I have made a pull request to make the message more accurate :)
Hello Swift Forums,
currently, as known @IBInspectable & @GKInspectable are only to be used as instance properties of class types, however, when incorrectly used as instance properties in another type, the error only instance properties can be declared @IBInspectable / @GKInspectable is blurted out
I believe the error message should be changed to reflect the attributes only being allowed to be used as class instance properties, say, only class instance properties can be declared @IBInspectable / @GKInspectable
3 Likes
Seems like a good enhancement bug at Issues · apple/swift · GitHub.
1 Like
Serena
(Serena)
3
If no disagreements are presented in this thread, I’ll instead open a pull request to change the error message today or tomorrow
1 Like
Unless the error message is specific to IBInspectable, there will probably need to be more consideration than just changing the message.
Serena
(Serena)
5
The error message is very well specific to IBInspectable and GKInspectable by looking at DiagnosticSema.def.
2 Likes
Serena
(Serena)
6
2 Likes