Group Group Group Group Group Group Group Group Group
raywenderlich.com Forums

Video Tutorial: Beginning Swift 2 Part 2: Variables & Constants

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

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.