Programming in Swift · Booleans and Operators | Ray Wenderlich


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5994-programming-in-swift/lessons/6

Hello, I have a problem with my code, that’s an error with let min: Int
rror: Booleans.playground:67:1: error: variables currently must have an initial value when entered at the top level of the REPL

let min: Int

^

Hi! We found this bug during another video, actually. Try switching your playground to automatic execution and it should work.

Currently, if you’re using manual execution, you can’t declare variables or constants without an initial value. You can absolutely do so in Swift! Just not in a playground using manual execution.

1 Like

Thank you) It works)

1 Like

You said “there are no & and | operators in Swift” - and that’s misleading, because there are & and | operators, although they are not logical but bitwise.

1 Like