Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documentation conventions for Swift enums

Tags:

swift

On the Apple API docs the enumeration is listed as deleteSelf yet in my Xcode the actual enumeration seems to be DeleteSelf - note the capitalisation difference at the start. Not a big deal but wasted some time trying to figure out why it would not recognise that enumeration.

Is there some documentation convention or is that a mistake on the Apple site?

like image 743
Friedrich 'Fred' Clausen Avatar asked Oct 19 '22 01:10

Friedrich 'Fred' Clausen


1 Answers

This has to do with the updated API Guidelines in Swift 3. Before Swift 3 enumeration cases were supposed to be written in UpperCamelCase, whereas now the standard has changed to lowerCamelCase. The inconsistencies that you've experienced might be due to the fact that you are not using Swift 3.0 yet.

like image 106
Marcus Rossel Avatar answered Oct 22 '22 04:10

Marcus Rossel