상세 컨텐츠

본문 제목

Day7. Closures, part two.

TIL/#100DaysOfSwiftUI

by box-jeon 2019. 12. 28. 10:03

본문

https://www.hackingwithswift.com/100/swiftui/7

 

100 Days of SwiftUI – Day 7 – Hacking with Swift

100 Days of SwiftUI The 100 Days of SwiftUI is a free collection of videos, tutorials, tests, and more to help you learn SwiftUI faster. Click here to learn more, or watch the video below. Back to 100 Days of SwiftUI

www.hackingwithswift.com

Closure를 function parameter로 쓰는 건 익숙한데, return type으로 사용하기 시작하니 서서히 눈이 어지러워집니다. 각 영상에 이어지는 test도 조금씩 어려워지고 있네요. SwiftUI에서 엄청 쓸테니 두번세번 반복해서 확실히 익히고 지나가라고 신신당부합니다. Single line으로 이루어진 closure의 경우, return keyword를 생략할 수 있는데, 중괄호까지 포함해서 한줄로 작성하는 경우가 아니면 오히려 가독성을 떨어뜨리는 게 아닌가 하는 생각이 들었습니다.

'TIL > #100DaysOfSwiftUI' 카테고리의 다른 글

Day 9. Structs, part two.  (0) 2019.12.29
Day 8. Structs, part one.  (0) 2019.12.28
Day 6. Closures, part one.  (0) 2019.12.27
Day 5. Functions.  (0) 2019.12.26
Day 4. Loops.  (0) 2019.12.24

관련글 더보기

댓글 영역