■ このスレッドは過去ログ倉庫に格納されています
let s: プログラミング言語? = Swift[2]
- 1 :名称未設定:2014/08/23(土) 09:55:25.03 ID:vQdcSMFci.net
- Appleの新言語Swiftについて語りましょう
Apple Developer
ttps://developer.apple.com/swift/
Welcome to Swift
ttps://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/LandingPage/
書籍iBooks:
The Swift Programming Language
ttps://itunes.apple.com/jp/book/swift-programming-language/id881256329?mt=11
Using Swift with Cocoa and Objective-C
ttps://itunes.apple.com/jp/book/using-swift-cocoa-objective/id888894773?mt=11
書籍の形にはなってないけどドキュメント
The Swift Programming Language
ttps://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
ttps://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097
Swift Standard Library Reference
ttps://developer.apple.com/library/prerelease/ios/documentation/General/Reference/SwiftStandardLibraryReference/
Swift Blog
ttps://developer.apple.com/swift/blog/
Resources (Xcode 6が無料でダウンロードできる)
ttps://developer.apple.com/swift/resources/
関連スレ
Swift part3
http://peace.2ch.net/test/read.cgi/tech/1406083608/
前スレ
プログラミング言語Swift
http://anago.2ch.net/test/read.cgi/mac/1401736921/
- 51 :名称未設定:2014/08/25(月) 15:10:31.78 ID:F9KUcJJc0.net
- 文字列の操作がもやもやしてたけどこのページは参考になった
Swift Techniques: Strings
http://www.chrismontrois.net/2014/08/02/swift-techniques-strings/
ベースはiOS Developer Library のNSString で有る事は言うまでもないが
NSStringのネーミングは長すぎるからもう少し簡潔にしないんだろうか
このページの =~ で RegExをサーチするようなのを標準で入れるとか
(RegEX自体は古臭くて好きじゃないけど)
- 52 :名称未設定:2014/08/25(月) 15:16:12.85 ID:Q6/R9Z+g0.net
- RegExを関数に置き換えるようなのが有っても良いと思うんすよ
Not()とかRange()とかAny()とか
- 53 :名称未設定:2014/08/25(月) 16:26:53.14 ID:c4zKJWTe0.net
- 変数の型を調べるうまい方法はないですかね?
- 54 :名称未設定:2014/08/25(月) 22:43:39.15 ID:skAEvINY0.net
- >>52
verbal expressions?
- 55 :名称未設定:2014/08/25(月) 23:00:34.64 ID:zsA7o60A0.net
- C++ の constexpr の様なのが欲しい
- 56 :名称未設定:2014/08/25(月) 23:36:02.72 ID:QqLylDvWi.net
- Pythonのtype()みたいのが欲しいです。
- 57 :名称未設定:2014/08/26(火) 00:26:45.76 ID:2UMJDwPt0.net
- >>54 Swift の VarbalExpressionsも出来てるね
https://github.com/VerbalExpressions/SwiftVerbalExpressions
// 例 Create an example of how to test for correctly formed URLs (注:全角空白使用)
let tester = VerEx()
.startOfLine()
.then("http")
.maybe("s")
.then("://")
.maybe("www")
.anythingBut(" ")
.endOfLine()
// Create an example URL
let testMe = "https://www.google.com"
// Use =~ operator
if testMe =~ tester {
println("We have a correct URL") // This output will fire
}
else {
println("The URL is incorrect")
}
println(tester) // Outputs the actual expression used: "^(?:http)(?:s)?(?::\/\/)(?:www)?(?:[^
//Shorthand for string replace:
let result2 = VerEx().find("red").replace("We have a red house", with: "blue")
- 58 :名称未設定:2014/08/26(火) 08:14:44.32 ID:k7xJfbWJ0.net
- Javaの instanceof っぽいのが欲しいかな
- 59 :名称未設定:2014/08/26(火) 09:21:09.66 ID:2UMJDwPt0.net
- >>58 === じゃダメ?
Identical to (===)
Not identical to (!==)
Use these operators to check whether two constants or variables refer to the same single instance:
- 60 :名称未設定:2014/08/26(火) 10:15:20.71 ID:KxpwCchCi.net
- >>58 is じゃダメ?
is Type check
as Type cast
class Animal {
}
class Cat: Animal {
}
let mike: Animal = Cat()
mike is Cat
総レス数 982
220 KB
新着レスの表示
掲示板に戻る
全部
前100
次100
最新50
read.cgi ver 2014.07.20.01.SC 2014/07/20 D ★