LoginSignup
10
10

More than 5 years have passed since last update.

IOS8 beta5のSwift変更点について

Last updated at Posted at 2014-08-09

メンバー変数にpublic修飾子が使えなくなった

次の書き方では「internal class canont have a public var」とエラーが出ます。

public var list:NSMutableArray!

修飾子をpublicからinternalに変更したら直りました。

internal var list:NSMutableArray!

※swiftの修飾子

  • public : どこからでもアクセス可能
  • internal : 同じターゲットからアクセス可能
  • private : 同じファイル内のみアクセス可能

条件分でnil判定は明示的に記述する必要がある

beta4までは以下の条件分でもビルドができた。

var item:NSMutableDictionary!
if item? {
    item.setObject(contents, forKey: elementName)
}

beta5では明示的にnilを明記しないとエラーになる。

var item:NSMutableDictionary!
if item != nil {
    item.setObject(contents, forKey: elementName)
}

iconが変わった

swiftの仕様とは関係ないけど、、swiftファイルのiconが文字「S」から鳥?に変わった。

ViewController_swift.png

その他

以下の内容を参考
http://qiita.com/susieyy/items/d3013fd04bcb21cd5227

10
10
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
10
10