Created
July 25, 2018 16:26
-
-
Save andru255/24261db5b6418c7c442c3934b97a7a38 to your computer and use it in GitHub Desktop.
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 NetworkAdapter { | |
public func requestServiceSuccess(url: String, method: RequestMethod = .GET, success: SuccessCallback = nil, fail: FailCallback = nil){ | |
let path = "Sources/data/response.json" | |
let fileManager = FileManager() | |
if let content = fileManager.contents(atPath: path), | |
let successCallback = success { | |
successCallback(content) | |
} | |
} | |
public func requestServiceFail(url: String, method: RequestMethod = .GET, success: SuccessCallback = nil, fail: FailCallback = nil ) { | |
if let failCallback = fail { | |
failCallback("error found") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment