Skip to content

Instantly share code, notes, and snippets.

class Hoge{
class var hoge:Int{
get{
return 0;
}
}
}
@corosukeK
corosukeK / gist:1df650314fddee6bf8ce
Created September 9, 2014 02:27
xcode6-Swift環境手順
1. https://developer.apple.com/xcode/downloads/ から XCode6 preview 入れる
2. https://developer.apple.com/downloads/index.action から Command Line Tool (2014 Sep) 入れる
3. sudo xcode-select -s /Applications/Xcode6-Beta7.app
4. xcode-select --print-path でBeta7が選択されていることを確認する
番外 元に戻したい場合はsudo xcode-select --resetを実行する
ターミナルでxcrun swiftでREPLがうごくはず
enum Size: Int {
case L = 1
case M = 2
case S = 3
}
var size: Size? = nil
func onSizeSelected(size: Size) {
self.size = size
struct Size {
static var L = Size(size: 1)
static var M = Size(size: 2)
static var S = Size(size: 3)
private var size: Int
private init(size: Int){
self.size = size
}
@corosukeK
corosukeK / gist:f5fc72d472d930991067
Created September 10, 2015 07:23
Syncで使われているライブラリ(ライセンス表記から抽出した)
・Cocoapods
AF+Image+Helper
ARChromeActivity
Aspects
Bolts
CocoaSecurity
Colours
Crashlytics
DACircularProgress
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let selectedCell = tableView.cellForRowAtIndexPath(indexPath)
tableView.visibleCells.forEach { (cell) -> () in
cell.accessoryType = .None
}
selectedCell?.accessoryType = .Checkmark
tableView.deselectRowAtIndexPath(indexPath, animated: true)
}