LoginSignup
12
12

More than 5 years have passed since last update.

Swift の true と TRUE は別物です。

Last updated at Posted at 2014-06-06

Swift の Bool は true or false

Swift で Bool 型として扱われるのは、 true or false だけです。

じゃあ TRUE とか FALSE ってなんなのなの?

互換用に定義されている、 Int 型を返すマクロです。

Sample

TRUE == 1 // true
TRUE == 0 // false
TRUE == -1 // false

FALSE == 0 // true
FALSE == 1 // false
FALSE == -1 // false

 

さよなら YES or NO
12
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
12