Networking library written in Swift used in MBurger and other Mumble projects.
With Xcode 11 you can start using Swift Package Manager to add MBNetworkingSwift to your project. Follow those simple steps:
https://github.com/Mumble-SRL/MBNetworkingSwift.git
in the "Choose Package Repository" dialog and press Next.MBNetworkingSwift
library and add it to your app target.CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate MBNetworkingSwift into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'MBNetworkingSwift'
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate MBNetworkingSwift into your Xcode project using Carthage, specify it in your Cartfile:
github "Mumble-SRL/MBNetworkingSwift"
Copy and paste the content of the MBNetworking folder in your project
Example usage:
let urlString = "https://www.example.com/api/test"
let headers = [HTTPHeader(field: "Accept", value: "application/json")]
let parameters = ["key": "value"]
MBNetworking.request(withUrl: urlString,
method: .get,
headers: headers,
parameters: parameters,
encoding: URLParameterEncoder.default) { response in
switch response.result {
case .success(let json):
print(json)
case .error(let error):
print(error.localizedDescription)
}
}
link |
Stars: 0 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics