Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 1
    As Bill says, that's the not the same but that's I need ! Commented Apr 21, 2015 at 21:41
  • @VincentSaluzzo, (and Bill) What the difference between this and class variable? Commented May 13, 2015 at 8:40
  • The Apple documentation have changed recently to update status : developer.apple.com/library/ios/documentation/Swift/Conceptual/… In fact, class keyword can only used for computed properties now and static are for all type properties (in enum, class or struct) Commented May 13, 2015 at 13:08
  • @skywinder As I mentioned in my answer, true class variables can be inherited by subclasses. Static variables can't. Commented May 13, 2015 at 15:47
  • @VincentSaluzzo Does Apple update its document? developer.apple.com/library/ios/documentation/Swift/Conceptual/… look at the fourth paragraph: "For value types (that is, structures and enumerations), you can define stored and computed type properties. For classes, you can define computed type properties only." Commented Jul 17, 2015 at 14:05