In Swift, you use `static in struct and enum` and `class in class`. For
example,

struct Foo {

    static func bar() {



    }

}


class ClassFoo {

    class func bar() {



    }

}


Another the `class func bar()` can replace to `static` as well. Here the
`static` and `class` are equal in functions of classes.


And `class` is a keyword.


class ClassFoo2 {

    static func bar() {



    }

}


Zhaoxin



On Fri, May 12, 2017 at 12:17 AM, Jose Cheyo Jimenez via swift-users <
swift-users@swift.org> wrote:

> I was expecting static to be a builtin. Does anybody know why it must be a
> keyword?
>
> Background. https://bugs.swift.org/browse/SR-4834
>
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
>
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to