Skip to content

Instantly share code, notes, and snippets.

@emenegro
Last active March 21, 2017 21:04
Show Gist options
  • Save emenegro/70077067965de39da3e180a5ad023ad0 to your computer and use it in GitHub Desktop.
Save emenegro/70077067965de39da3e180a5ad023ad0 to your computer and use it in GitHub Desktop.
class OfflineActionBuilder {
fileprivate var action: OfflineAction!
init() {
fatalError("This type cannot be constructed directly, use static var 'builder' instead.")
}
private init(_ action: OfflineAction) {
self.action = action
}
static var builder: RequestStep {
return OfflineActionBuilder(OfflineAction()) as RequestStep
}
}
extension OfflineActionBuilder: RequestStep, DataStep, CommonsStep, CacheCommonsStep, GetCommonsStep {
// Implementations of each protocol above.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment