TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Meniny.
MXNetworing
is a delightful networking framework for iOS platform.
Requre Swift 3.0+.
// MARK: BASR URL
MXNetworking.setBaseURLString("http://exp.yourdomain.com")
// MARK: REQUEST HEADERS
var headers = URLRequest.standardHeaders()
headers["Accept"] = "*/*"
URLRequest.setStandardHeaders(headers)
let url = MXNetworking.urlByAppendingParameters(["device": "iphone5", "version": "1.0.0"], toURL: "/exp_name.php")
MXNetworking.getRequestByAppending(url, forType: RequestType.url, data: nil) { (status, responseObject, error) in
if status == ResponseStatus.success {
// code here...
} else {
// code here...
}
}
Add this to your Info.plist
file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</plist>