Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rushisangani/networkkit
Testable network layer seamlessly integrating Combine Framework, and Async/Await using Swift Package
https://github.com/rushisangani/networkkit
async-await combine-framework framework ios-network-layer swift swiftpackagemanager
Last synced: about 1 month ago
JSON representation
Testable network layer seamlessly integrating Combine Framework, and Async/Await using Swift Package
- Host: GitHub
- URL: https://github.com/rushisangani/networkkit
- Owner: rushisangani
- Created: 2024-01-17T12:41:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-18T08:17:39.000Z (11 months ago)
- Last Synced: 2024-10-13T14:44:15.699Z (2 months ago)
- Topics: async-await, combine-framework, framework, ios-network-layer, swift, swiftpackagemanager
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NetworkKit
iOS app's connectivity with NetworkKit – a simple yet powerful network layer seamlessly integrating Combine Framework, Async/Await, and Unit Tests.
# GitHub Repos
Checkout this sample project [SwiftMVVMDemo](https://github.com/rushisangani/SwiftMVVMDemo).
## Examples
```swift
public protocol NetworkHandler {
func fetch(request: Request) async throws -> T
func fetch(request: Request) -> AnyPublisher
}
``````swift
import NetworkKitclass PostService: PostRetrievalService {
let networkManager: NetworkHandler
init(networkManager: NetworkHandler = NetworkManager()) {
self.networkManager = networkManager
}
func getPosts() async throws -> [Post] {
try await networkManager.fetch(request: PostRequest.getPosts)
}
}
```### Installation
Add `NetworkKit` to your project using Swift Package Manager - https://github.com/rushisangani/NetworkKit
## Contributions
Feel free to submit issues or pull requests to enhance the functionality of NetworkKit.
## Connect with Me
Connect with me on [LinkedIn](https://www.linkedin.com/in/rushisangani/) or follow me on [Medium](https://medium.com/@rushisangani).