async/await_wwdc_추가필요

hankyulee·2022년 5월 22일
0

WWDC

목록 보기
2/2

WWDC 2021
Async/await

Completion handler 보다 쉽게 async 처리할 수 있도록 만든것. + safer + shorter
경험: string->uiImage 할때 urlrequest, datatask, 변환 과정. 이중에 사실 request와 변환과정은 빠르다.
함수내에 completion 쓰는 거 깜빡한적 있다. -> 가져온 데이터가 출력이 안되겠지..
그러니까 실패해도 completion(nil,error)을 호출하자..!
방지하기 위해 .success = 그러나 코드가 길어진다.
읽기전용 프로퍼티에 async await 가능. - swift5.5 부터 property도 throw 가능.

-18:18
https://developer.apple.com/videos/play/wwdc2021/10132/?time=9

0개의 댓글