Latest 2.0.1
Homepage https://github.com/Meniny/MXNetworking-in-Swift
License MIT
Platforms ios 8.0
Dependencies Reachability
Frameworks Foundation, UIKit

MXNetworking-in-Swift

MXNetworing is a delightful networking framework for iOS platform.

Requre Swift 3.0+.

Installation with CocoaPods

pod 'MXNetworkingSwift'

Usage

  • Base URL
// MARK: BASR URL
MXNetworking.setBaseURLString("http://exp.yourdomain.com")
  • Request Headers
// MARK: REQUEST HEADERS
var headers = URLRequest.standardHeaders()
headers["Accept"] = "*/*"
URLRequest.setStandardHeaders(headers)
  • Sample Request
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...
    }
}

Trouble Shooting

  • ATS

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>

Latest podspec

{
    "name": "MXNetworkingSwift",
    "version": "2.0.1",
    "summary": "A delightful networking framework for iOS platform.",
    "description": "A stable version of MXNetworing, a delightful networking framework for iOS platform.",
    "homepage": "https://github.com/Meniny/MXNetworking-in-Swift",
    "license": "MIT",
    "authors": "Elias Abel",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Meniny/MXNetworking-in-Swift.git",
        "tag": "2.0.1"
    },
    "source_files": "MXNetworking-Swift/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "dependencies": {
        "Reachability": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This