Created
May 19, 2015 06:58
-
-
Save corosukeK/65040ae445b92c8e1885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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