로딩
요청 처리 중입니다...

[Swift]Generic(2) - Type

 [Swift]Generic(2) - Type

Generic Types In addition to generic functions, Swift enables you to define your own generic types. These are custom classes, structures, and enumerations that can work with any type, in a similar way to Array and Dictionary.

Swift는 내가 원하는 제네릭 타입을 만들 수 있게 한다. 그 예시로 Stack을 한번 보자 This section shows you how to write a generic collection type called Stack.

A stack is an ordered set of values, similar to an array, but with a more restricted set of operations than Swift’s Array type. An array allows n...