Last active
March 21, 2017 21:04
-
-
Save emenegro/70077067965de39da3e180a5ad023ad0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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