> On 7 Sep 2016, at 11:42, Quincey Morris <quinceymor...@rivergatesoftware.com> 
> wrote:
> 
> On Sep 6, 2016, at 21:31 , Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:
>> 
>> My Swift book (2.2) has no mention of “private” (Swift 3 beta has).
> 
> It’s in the 2.2 book under “Language Guide” section “Access Control”

You are right. I used Books.app on my iPad to search for “private” and it found 
only private-use Unicode code points.
Probably my iPad is broken.

> 
>> But even assuming I had Swift 3, I do not quite understand how this should 
>> be done (I may be a bit dense).
> 
> It’s a bit of syntactical pseudo-magic, but it makes sense when you think 
> about it.

[…]

> In that case, you can freely change the value inside the class, but to 
> clients of the class, it “looks like” the property is declared like this: […]

I am more concerned with methods inside my class (and compiler optimisation, 
which might work better, if the compiler knows something to be constant).


> This use of ‘private(set)’ doesn’t prevent you from accidentally changing the 
> value inside the class somewhere. If you want to do that, you’re going to 
> have to get a bit more exotic, maybe a ‘lazy’ let.

I’ll try to read about “lazy”. But right now I am myself a bit lazy and must 
other things first.

Thanks a lot for your help!

Kind regards,

Gerriet.


_______________________________________________

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