> On May 17, 2016, at 7:48 AM, Neil Faiman via swift-users 
> <swift-users@swift.org> wrote:
> 
> “You can provide a default value for a stored property as part of its 
> definition, as described in Default Property Values. You can also set and 
> modify the initial value for a stored property during initialization. This is 
> true even for constant stored properties, as described in Assigning Constant 
> Properties During Initialization.” (Classes and Structures / Stored 
> Properties)

You can assign the value of an as-yet-unassigned ‘let’ property, once. If that 
happens in the default initialization phase (before any initializer methods 
run), then you’ve used up that chance. The initializer would be setting a 
second value, which isn’t allowed.

Read up on the phases of initialization in the Swift book.

—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to