let urlString = "https://httpbin.org/get"
let request = MRequest {
RMethod(.get)
RUrl(urlString: urlString)
/// somthing else
}
let socket = MSocket {
RUrl(urlString: urlString)
/// somthing else
}
socket.write(string: "something")
let socketIO = MSocketIO(withSourceURL: URL(urlString: "")!, timeout: 15, connectparams: [:])
socketIO.on("event")
request.sink { response in
debugPrint(response)
}
socket.sink { response in
debugPrint(response)
}
socketIO.on("event").sink { dict in
debugPrint(dict)
}
request.producer.startWithValues { response in
debugPrint(response)
}
socket.producer.startWithValues { response in
debugPrint(response)
}
socketIO.on("event").producer.startWithValues { dict in
debugPrint(dict)
}
request.subscribe { response in
debugPrint(response)
}
socket.subscribe { response in
debugPrint(response)
}
socketIO.on("event").subscribe { dict in
debugPrint(dict)
}
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, adding Networking as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/FullStack-Swift/Networking", .upToNextMajor(from: "1.0.0"))
]
link |
Stars: 1 |
Last commit: 5 weeks ago |
Release
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics