swift-concurrency
SKILL.md
Swift Concurrency
Expert guidance for modern Swift concurrency with async/await and actors.
Async/Await Basics
Async Functions
// Define async function
func fetchUser(id: Int) async throws -> User {
let url = URL(string: "https://api.example.com/users/\(id)")!
let (data, _) = try await URLSession.shared.data(from: url)
return try JSONDecoder().decode(User.self, from: data)
}