Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
- .Working: 描画する要素があり、アプリが正常に動いている状態
- .Blank: 描画する要素がない状態
- .Requesting: 描画する要素を読み込んでいる状態
- .Error(ErrorType): エラーが起きている状態
enum ViewState {
case Working
case Blank
case Requesting
case Error(ErrorType)
func fetchEnabled() -> Bool {
switch self {
case .Blank, .Working:
return true
return false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment