以下のコード:なぜInt(false)は動作しますが、Int(booleanVariable)は機能しませんか?
Int(false) // = 1, it's okay
//but when I try this
let emptyString = true //or let emptyString : Bool = true
Int(emptyString) //error - Cannot invoke initializer with an argument list of type '(Bool)'
誰もがこの事実を説明できますか?ややこしい。内部はどうなるの?
これは速やかな3では認められていません。 – Dili
私はそれが重複しているとは思わないが、質問は「方法」ではなく「なぜ」である。質問のタイトルは編集する必要があります。 –