Created
October 31, 2016 07:28
-
-
Save toshi0383/11289202d42804bde9235806b10f66f8 to your computer and use it in GitHub Desktop.
UIControlState.NormalがUIControlState()に変換されて何かと思ったらOptionSetだった。 #CodePiece
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
import UIKit | |
UIControlState().rawValue // 0 | |
UIControlState.normal.rawValue // 0 | |
enum A: OptionSet { | |
typealias RawValue = Int | |
case a, b | |
var rawValue: Int { | |
return 0 | |
} | |
init(rawValue: A.RawValue) { | |
self = .a | |
} | |
} | |
A() // a | |
A.a // a | |
A.b // b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment