逐次更新
data
dataという変数があると思っていて使おうとするもmodule is not convertible to~というエラーが出て使えなかった
→Swiftのdataモジュールというのが定義されていた
→試してないけどdataという変数名は使えないのでは
CGクラスのUnmanaged
返り値にUnmanagedがついているものはSwiftのメモリマネジメントに入れてやらないとそのまま使えない
→cgImage = unmanagedCGImage.takeRetainedValue()
参考: http://stackoverflow.com/questions/24215757/using-unmanagedanyobject-as-key-in-nsmutabledictionary
UICollectionViewCellサブクラスを使用するとき
なんか詰まったんだけど忘れた。なんだったかな…
readonly property
セッタを定義していないプロパティに値をセットしようとするとコンパイルエラーになる
var hoge: Hoge! {
get {
return (何か処理)
}
}
マクロ
ないっぽい
数値をフォーマットして文字列に変換
こんなん
String.localizedStringWithFormat("%02d", index)
Precision String Format Specifier In Swift - Stack Overflow - http://stackoverflow.com/questions/24051314/precision-string-format-specifier-in-swift/25915588#25915588
Macros in Swift? - Stack Overflow - http://stackoverflow.com/questions/24114288/macros-in-swift
CocoaPods
Masonry
そのほか
Swiftじゃないけど
http://d.hatena.ne.jp/ntaku/20110110/1294632603