Skip to content

Instantly share code, notes, and snippets.

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)
}
@corosukeK
corosukeK / gist:f5fc72d472d930991067
Created September 10, 2015 07:23
Syncで使われているライブラリ(ライセンス表記から抽出した)
・Cocoapods
AF+Image+Helper
ARChromeActivity
Aspects
Bolts
CocoaSecurity
Colours
Crashlytics
DACircularProgress
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
}
enum Size: Int {
case L = 1
case M = 2
case S = 3
}
var size: Size? = nil
func onSizeSelected(size: Size) {
self.size = size
@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がうごくはず
class Hoge{
class var hoge:Int{
get{
return 0;
}
}
}
class Hoge{
init(){
println("Hoge")
}
}
class Fuga{
init(){
println("Fuga")
}
import Foundation
func hoge() -> Int
{
println("Intだよー")
return 0
}
func hoge() -> String
{
@corosukeK
corosukeK / gist:3296536
Created August 8, 2012 16:44
HTTPLoader(改良してみるなど)
//
// HTTPLoader.m
// HTTPLoader
//
// Created by Keisuke Kimura on 2012/08/08.
// Copyright (c) 2012年 Keisuke Kimura. All rights reserved.
//
#import "HTTPLoader.h"
@corosukeK
corosukeK / gist:3294013
Created August 8, 2012 10:14
HTTPLoader
//
// HTTPLoader.m
// HTTPLoader
//
// Created by Keisuke Kimura on 2012/08/08.
// Copyright (c) 2012年 Keisuke Kimura. All rights reserved.
//
#import "HTTPLoader.h"