Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- modern concurrency deep dive
- ios
- modern concurrency
- 오블완
- WWDC
- SWIFT
- APNS
- 야곰 # 야곰아카데미커리어스타터캠프 #iOS개발자 # 부트캠프
- 티스토리챌린지
Archives
- Today
- Total
Geon
Modern Concurrency Deep Dive(4) 본문
iOS developer essential skills/Modern Concurency
Modern Concurrency Deep Dive(4)
jgkim1008 2024. 11. 17. 20:13WithUnsafeContinuation
- 런타임중 확인을 안하기에, continuation이 두번 호출되면 앱이 크래시가 난다.
WithCheckedContinuation
- 런타임중 확인을 하기에, continuation을 두번 호출해도 안전하다.
func asyncFetchImage() async -> UIImage? {
return await withCheckedContinuation { continuation in
fetchImage { image in
continuation.resume(with.success(image))
continuation.resume(with.success(image)) // checked 라 안전
}
}
'iOS developer essential skills > Modern Concurency' 카테고리의 다른 글
Modern Concurrency Deep Dive(6) (0) | 2024.11.19 |
---|---|
Modern Concurrency Deep Dive(5) (0) | 2024.11.18 |
Modern Concurrency Deep Dive(3) (0) | 2024.11.16 |
Modern Concurrency Deep Dive(2) (0) | 2024.11.15 |
Modern Concurrency Deep Dive(1) (0) | 2024.11.14 |