> 
> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to