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
- 티스토리챌린지
- WWDC
- 오블완
- APNS
- modern concurrency deep dive
- modern concurrency
- ios
- SWIFT
- 야곰 # 야곰아카데미커리어스타터캠프 #iOS개발자 # 부트캠프
Archives
- Today
- Total
목록modern concurrency (8)
Geon
Modern Concurrency Deep Dive(2)
Cancelvar task = Task { let continue = try await longTask() print(continue)}sleep(1)task.cancel()- 비동기 동작중, 취소를 콜하면 에러를 던진다.- yield 는 양보한다는 뜻 (중단 포인트를 만들어 준다)
iOS developer essential skills/Modern Concurency
2024. 11. 15. 23:49
Modern Concurrency Deep Dive(1)
Task- 비동기의 단위이다.- 내부에 self를 참조하고 있을때 기존의 DispatchQueue와 다르게 자동으로 self를 해제해준다.(Task closure lifetime)- 즉 캡쳐를 해도 상관은없으나, 필요한 사항이 아니면 할필요가 없다. final class Mock { var image: UIImage? func someFunction() asnyc -> UIImage? { Task { Task.sleep(5) image = UIImage() // self 선언 안해줘도 된다. } }} 출저: https://developer.apple.com/documentation/swift/task#Task-closure-lifetime
iOS developer essential skills/Modern Concurency
2024. 11. 14. 23:45