NetworkingKit is a Swift Package Manager (SPM) package that provides networking utilities for iOS applications. It offers convenient APIs for making HTTP requests, handling responses, and downloading images asynchronously.
HTTP Request Handling: Simplifies the process of making HTTP requests using URLSession. Error Handling: Provides robust error handling for network requests and responses. Asynchronous Image Downloading: Offers utilities for downloading images asynchronously from remote URLs.
- iOS 13.0+
- Xcode 13.0+
- Swift 5.5+
You can use Swift Package Manager to integrate NetworkingKit into your Xcode project. Follow these steps:
- In Xcode, select "File" -> "Swift Packages" -> "Add Package Dependency..."
- Enter the URL of this repository: https://github.com/ourangzeb/IOS-NetworkingKit.git
- Follow the prompts to specify the version or branch you want to use.
- Add NetworkingKit to your target dependencies.
dependencies: [
.package(url: "https://github.com/ourangzeb/IOS-NetworkingKit.git", .upToNextMajor(from: "1.0.0"))
]
import NetworkingKit
let resource = Resource(url: URL(string: "https://api.example.com/data")!)
let networkService = NetworkService()
do {
let responseData: Data = try await networkService.load(resource)
// Process responseData...
} catch {
// Handle error...
}import NetworkingKit
let imageURL = URL(string: "https://example.com/image.jpg")!
let imageService = ImageDownloadService()
do {
let downloadedImage: UIImage = try await imageService.downloadImage(from: imageURL)
// Use downloadedImage...
} catch {
// Handle error...
}Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
NetworkingKit is developed and maintained by Ourangzeb Khan.