Orta seviye
18 Kasım 2026Hatayı bul: iOS
Tek bir kod parçası. Hatayı bul ya da hata olmadığını kanıtla.
swift
1import Foundation
2
3struct User { let id: UUID }
4
5final class UserRepository {
6 func save(_ user: User) async throws { /* ... */ }
7}
8
9final class ProfileViewModel {
10 let repository: UserRepository
11
12 init(repository: UserRepository) {
13 self.repository = repository
14 }
15
16 func saveProfile(_ user: User) async {
17 do {
18 try await repository.save(user)
19 } catch {
20 print("Error: \(error)")
21 }
22 }
23}
24Soruna yol açan satırlara tıkla.
Kararın
Günde bir deneme. Cevap hemen ardından görünür.
Serini koru
Serini korumak ve ilerlemeni takip etmek için hesap oluştur.