タグ

Appleとswiftに関するlxyumaのブックマーク (2)

  • [Swift] Optional型についてのまとめ - Qiita

    この記事は一部内容が古くなったので、全面的に書き直した記事を別にあげました(14/10/17 追記)。 ↓ [Swift] Optional 型についてのまとめ Ver2 Optional型とは? Optional型 : nilが入るのを許す 非Optional型 : nilが入るのを許さない Optional型の宣言方法 var a: Int? // Optional型 var b: Int // 非Optional型 var c: String? // Optional型 var d: String // 非Optional型

    [Swift] Optional型についてのまとめ - Qiita
    lxyuma
    lxyuma 2015/11/23
    optional型 Int?はOptional<Int>のsyntax sugar/ wrapされてる = optionalに元の型が入ってる/unwrap = Optional<T>からT型変数を取り出す事Optional型変数に!付けるとunwrap/宣言時に!でimplicity Unwrapped Optinalkata
  • Swift Blog - Apple Developer

    In many cases, your code will not have to change significantly in response to this change. Code that in Swift 2 relied on value types implicitly converting to AnyObject will continue to work as-is in Swift 3 by passing as Any. However, there are places where you will have to change the declared types of variables and methods and get the best experience in Swift 3. Also, if your code is explicitly

    Swift Blog - Apple Developer
  • 1