[swift-users] Why can't Swift instance methods call class methods without qualification?
owenzx at gmail.com
Thu Jun 30 20:47:06 CDT 2016
Just a choice made by the language designers to distinguish the call at the
You should be aware of using static methods as it may change static
variables, which affects all instances of that class. Normally I think
static methods is designed to use outside the class instance, if you have
to use it inside its instance method. You may need to rethink the pattern
On Fri, Jul 1, 2016 at 8:59 AM, Rick Mann via swift-users <
swift-users at swift.org> wrote:
> Why can my instance methods not call class methods without the class
> class MyClass
> Why do I have to call MyClass.classMethod()? Just a choice made by the
> language designers to distinguish the call at the call site? I like C++'s
> way of treating all static methods as directly available to the instance.
> Rick Mann
> rmann at latencyzero.com
> swift-users mailing list
> swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users