Created
February 17, 2017 13:34
-
-
Save anuragajwani/2f0a5c24022fd709c246794cd8b0dda0 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
final class MyProtocolSharedInstanceSetter { | |
private let myProtocol: MyProtocol | |
init(myProtocol: MyProtocol, myApi: MyApi) { | |
self.myProtocol = myProtocol | |
myApi.getRequest(onCompletion: { [weak self] in myProtocol.sharedInstance = $0 } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment