Skip to content

Instantly share code, notes, and snippets.

@corosukeK
Created May 19, 2015 06:58
Show Gist options
  • Save corosukeK/65040ae445b92c8e1885 to your computer and use it in GitHub Desktop.
Save corosukeK/65040ae445b92c8e1885 to your computer and use it in GitHub Desktop.
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
}
var rawValue: Int {
return size
}
}
var size: Size? = nil
func onSizeSelected(size: Size) {
self.size = size
}
func onSizeCleared() {
self.size = nil
}
@IBAction func onSendButtonTouched() {
if let size = self.size {
send(size)
} else {
// Dialog.show("サイズを選択してください")
}
}
func send(size: Size) {
// Post.request(url,parameter:["size" : size.rawValue]).execute()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment