Re: Init in Swift
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