Go beyond just values in your Swift 2 playground and look at variables, constants, and a little more about the type system.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3250-beginning-swift-2/lessons/3
Go beyond just values in your Swift 2 playground and look at variables, constants, and a little more about the type system.
Question for Greg -
When I type βlet tipPercentage: Double = 0.15β into the playground, the right panel displays the value β0β. On the video, the same value is displayed as β0.15.β
Can you offer an explanation as to why Xcode would evaluate the same expression differently? Iβm using version 7.3.1.
Thanks!
Brian
Update. As soon as I assigned a value to the totalBill, tipPercentage changed from 0 to .15. I undid my change, unassigning totalBill, as the tipPercentage did not change back to 0. Have to love the IDE. Oh how I miss Vim and irb.