상세 컨텐츠

본문 제목

Day11. Protocols and extensions.

TIL/#100DaysOfSwiftUI

by box-jeon 2020. 1. 1. 11:03

본문

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

 

100 Days of SwiftUI – Day 11 – 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

Protocol입니다. Class Inheritance와 Protocol Conformance 중 하나를 고민해야할 때가 많은데, 언제나 부담없는 것은 protocol 쪽입니다. 만약 모델을 struct로 구현한다면 선택의 여지가 없겠죠. Protocol Oriented Programming은 2015년 WWDC에서 소개되면서 많은 개발자들을 흥분시켰는데, 막상 돌이켜보니 protocol extension을 통해 default implementation을 제공할 수 있다는 기능 외에는 별로 기억나는 게 없네요. 다시 한번 살펴봐야할 것 같습니다.

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

Day 13. Swift review, day one  (0) 2020.01.19
Day 12. Optionals.  (0) 2020.01.06
Day 10. Classes.  (0) 2019.12.31
Day 9. Structs, part two.  (0) 2019.12.29
Day 8. Structs, part one.  (0) 2019.12.28

관련글 더보기

댓글 영역