+ 4
Swift question mark
I'm still confused about the ? in swift . I even googled what it means but I still don't understand it. Can someone please help me?
4 Answers
+ 3
Thanks ChillPill
+ 2
Thank you bendjebbar
+ 1
//You can also use it (?) like this exemple :
let x = 10 // while x < 20 , i take value of i else i take value of 2*x
var i = x<20 ? x : 2*x
0
This operator is available in many languages, not just Swift.