Protocol
-
some - opaque type 특정 프로토콜을 준수하는 것을 나타내는 불투명 유형을 만들기 위해 프로토콜과 함께 사용된다. 불투명 유형의 기본 유형은 변수 scope 내에서 하나로 고정되어야 합니다. 같은 구체 타입의 새로운 인스턴스를 변수에 할당하는 것도 금지되어 있습니다. 배열이나 리턴타입에서도 하나의 구체 타입으로 고정되어야 합니다. any - existential type Existential Type (Existentials, 실존타입, 실존유형) protocol과 associated type을 이용하여 특정 바운더리로 제약시키는 방법 Swift 5.7부터 실존 타입에는 any를 쓰는 것이 필수다. 왜냐하면 실존타입을 사용하는 것이 동적 타입 결정으로 인한 성능 저하를 불러올 수 있음에도 너..
some, anysome - opaque type 특정 프로토콜을 준수하는 것을 나타내는 불투명 유형을 만들기 위해 프로토콜과 함께 사용된다. 불투명 유형의 기본 유형은 변수 scope 내에서 하나로 고정되어야 합니다. 같은 구체 타입의 새로운 인스턴스를 변수에 할당하는 것도 금지되어 있습니다. 배열이나 리턴타입에서도 하나의 구체 타입으로 고정되어야 합니다. any - existential type Existential Type (Existentials, 실존타입, 실존유형) protocol과 associated type을 이용하여 특정 바운더리로 제약시키는 방법 Swift 5.7부터 실존 타입에는 any를 쓰는 것이 필수다. 왜냐하면 실존타입을 사용하는 것이 동적 타입 결정으로 인한 성능 저하를 불러올 수 있음에도 너..
2023.07.25 -
Swift 개발자라면 한 번 쯤 봤을법한 아래 영상을 리마인드할 겸 다시 리뷰하던 중 이런 궁금증이 생겼다. https://developer.apple.com/videos/play/wwdc2016/416/ Understanding Swift Performance - WWDC16 - Videos - Apple Developer In this advanced session, find out how structs, classes, protocols, and generics are implemented in Swift. Learn about their relative... developer.apple.com "protocol을 채택하지 않는 struct도 3word가 넘으면 데이터가 heap에 저장될까?" 사실..
protocol을 채택하지 않는 struct도 3word가 넘으면 데이터가 heap에 저장될까?Swift 개발자라면 한 번 쯤 봤을법한 아래 영상을 리마인드할 겸 다시 리뷰하던 중 이런 궁금증이 생겼다. https://developer.apple.com/videos/play/wwdc2016/416/ Understanding Swift Performance - WWDC16 - Videos - Apple Developer In this advanced session, find out how structs, classes, protocols, and generics are implemented in Swift. Learn about their relative... developer.apple.com "protocol을 채택하지 않는 struct도 3word가 넘으면 데이터가 heap에 저장될까?" 사실..
2023.07.19