トップページ⇒tech
1001コメント317KB

Swift part3

■ このスレッドは過去ログ倉庫に格納されています
0001デフォルトの名無しさん2014/07/23(水) 11:46:48.42ID:x29J8vdY
WWDC2014で発表されたAppleの新言語Swiftについて語りましょう

Apple Developer
https://developer.apple.com/swift/
Welcome to Swift
https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/LandingPage/
iBooks: The Swift Programming Language
https://itunes.apple.com/jp/book/swift-programming-language/id881256329?mt=11
書籍の形にはなってないけどドキュメント
The Swift Programming Language
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097
Using Swift with Cocoa and Objective-C
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097
Swift Standard Library Reference
https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/SwiftStandardLibraryReference/
Swift Blog
https://developer.apple.com/swift/blog/
Resources (Xcode 6が無料でダウンロードできる)
https://developer.apple.com/swift/resources/

関連スレ
TypeScript(MS) VS Swift(Apple)
http://peace.2ch.net/test/read.cgi/tech/1401758403/
帰ってきた動的言語 VS 静的言語(代表Swift)
http://peace.2ch.net/test/read.cgi/tech/1401809550/

前スレ
Swiftスレ
http://peace.2ch.net/test/read.cgi/tech/1401736341/
Swift part2
http://peace.2ch.net/test/read.cgi/tech/1402465335/
0082デフォルトの名無しさん2014/08/17(日) 13:26:01.14ID:V8SXHhEt
>>80
上は Foundation.NSDictionary になるからダメ
下は Swift.Dictionary<String, Any> だからおk

ちな
var d = ["a": 10, "b": "BBB"].mutableCopy()
d.setObject("123", forKey: "C")
println(d.description)

{
C = 123;
a = 10;
b = BBB;
}

NSMutableDictionaryにしてもSwiftのsubscript持ってないから使いにくいね
0083デフォルトの名無しさん2014/08/17(日) 13:29:48.59ID:V8SXHhEt
あ、勘違い
NSMutableDictionary でも subscript 使えたわw

var d = ["a": 1, "b": "2"].mutableCopy() as NSMutableDictionary
d["c"] = 9
println(d)
0084デフォルトの名無しさん2014/08/17(日) 13:31:26.48ID:V8SXHhEt
あ、mutableCopy() なくてもいけたw

var d = ["a": 1, "b": "2"] as NSMutableDictionary
d["c"] = 9
println(d)

連レススマソ
■ このスレッドは過去ログ倉庫に格納されています