LoginSignup
2
2

More than 3 years have passed since last update.

【Swift】こんな書き方もできる三項演算子

Last updated at Posted at 2019-06-27

よく見る三項演算子

let data = flg == true ? self.toData("1") : self.toData("0")

応用

let data = self.toData(flg? "1" : "0")
2
2
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
2
2