ViewStateProtocol extension
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
extension ViewStateProtocol where Self: UIViewController { | |
// State manager class to remove/add views | |
var stateManager: StateManager? { | |
return StateManager.sharedInstance | |
} | |
// Loading view | |
var loadingView: UIView? { | |
return LoadingView(frame: UIScreen.main.bounds) | |
} | |
// Error View | |
var errorView: UIView? { | |
return ErrorState(frame: UIScreen.main.bounds) | |
} | |
// Empty view | |
var emptyView: UIView? { | |
return EmptyStateView(frame: UIScreen.main.bounds) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment