• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why can't a Swift method directly access a static member?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why can't a Swift method directly access a static member?


  • Subject: Why can't a Swift method directly access a static member?
  • From: Rick Mann <email@hidden>
  • Date: Wed, 25 Nov 2015 00:34:46 -0800

It seems rather lame that a Swift instance method can't access a static member without prefixing it with the class. Why is this? This is something C++ and Java do just fine.

(I have a similar question for Objective-C, which can't access a class method via self).

--
Rick Mann
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Why can't a Swift method directly access a static member?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Swift - internal class conforming to public protocol
  • Next by Date: Re: Swift - internal class conforming to public protocol
  • Previous by thread: Re: Avoid selection marking on cell tap
  • Next by thread: Re: Why can't a Swift method directly access a static member?
  • Index(es):
    • Date
    • Thread