Created
July 18, 2017 03:41
-
-
Save spadafiva/a83da7b22b9b07a221b6ed792d979df3 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
enum Mode { | |
case viewing | |
case editing | |
case creating | |
var textfieldsEditable: Bool { | |
switch self { | |
case .editing, .creating: return true | |
case .viewing: return false | |
} | |
} | |
var secondaryButtonHidden: Bool { | |
switch self { | |
case .viewing: return true | |
case .editing, .creating: return false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment