• 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
Re: Init in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Init in Swift


  • Subject: Re: Init in Swift
  • From: Marco S Hyman <email@hidden>
  • Date: Tue, 06 Sep 2016 21:48:25 -0700

>
> My Swift book (2.2) has no mention of “private” (Swift 3 beta has).
> But even assuming I had Swift 3, I do not quite understand how this should be done (I may be a bit dense).

Page 508 in the Swift 2.2 book I just downloaded from iBooks.

“Getters and Setters
Getters and setters for constants, variables, properties, and subscripts automatically receive the same access level as the constant, variable, property, or subscript they belong to.

You can give a setter a lower access level than its corresponding getter, to restrict the read-write scope of that variable, property, or subscript. You assign a lower access level by writing private(set) or internal(set) before the var or subscript introducer.

”

Excerpt From: Apple Inc. “The Swift Programming Language (Swift 2.2).” iBooks. https://itun.es/us/jEUH0.l



_______________________________________________

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


References: 
 >Init in Swift (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Init in Swift (From: Quincey Morris <email@hidden>)
 >Re: Init in Swift (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Init in Swift (From: Quincey Morris <email@hidden>)
 >Re: Init in Swift (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Init in Swift
  • Next by Date: Re: Init in Swift
  • Previous by thread: Re: Init in Swift
  • Next by thread: Re: Running apps compiled for newer OS X versions on older versions (rant)
  • Index(es):
    • Date
    • Thread