What does {{{…}}} mean in Swift? -


i wrote following code in playground.

struct product {      var randomnumber: int?     init?(number: int){         if number <3 {return nil}         randomnumber=number      } } var mug = product(number: 5)        // {{{…}}} 

in output on right {{{…}}} indicated comment. symbols mean?

it's shorthand notation indicates different levels of wrapping. xcode telling what's in variable mug outermost curly-brackets wrapping around optional. second level of brackets wraps around struct properties , third level of wrapping optional wrapped around randomnumber property. can visualize doing this.

var mug = product(number: 5) // {{{...}}} var amug = mug! // {{some 5}} var bmug = mug!.randomnumber // {some 5} var cmug = mug!.randomnumber! // 5 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -