Loading...
Loading...
Master iOS networking - URLSession, async/await, REST APIs, authentication
npx skill4agent add pluginagentmarketplace/custom-plugin-ios ios-networkingBuild robust network layers for iOS applications
| Requirement | Level |
|---|---|
| iOS Fundamentals | Completed |
| Swift | Intermediate |
| async/await | Basic |
func fetch<T: Decodable>(_ type: T.Type, from url: URL) async throws -> T {
let (data, response) = try await URLSession.shared.data(from: url)
guard let httpResponse = response as? HTTPURLResponse,
(200...299).contains(httpResponse.statusCode) else {
throw NetworkError.invalidResponse
}
return try JSONDecoder().decode(T.self, from: data)
}| Criteria | Weight |
|---|---|
| API client design | 30% |
| Error handling | 25% |
| Authentication | 25% |
| Testing | 20% |