SlideShare a Scribd company logo
1 of 10
Extensions
Swift
순서
1. Extensions ?
2. 확장 문법
3. 연산 속성
4. 이니셜라이저
5. 메소드
6. Mutating 인스턴스 메소드
7. Subscripts
8. Nested Types
Extensions
이미 존재하는 class, struct, enum 에
새 기능을 추가합니다 .
•computed properties, computed static
properties
•인스턴스 메소드와 타입 메소드 정의
•새로운 이니셜라이저 제공
•서브스크립트 정의
•기존 타입에 프로토콜 적용시키기
확장 문법
// extension 키워드를 사용합니다 .
extension SomeType {
// SomeType 에 추가할 새 기능
}
extension SomeType: SomeProtocol,
AnotherProtocol {
// 프로토콜의 요구사항을 이곳에 구현
}
연산 속성
이니셜라이저
메소드
Mutating 인스턴스 메소드
Subscripts
Nested Types

More Related Content

What's hot (12)

Tcpl 12장 파생클래스
Tcpl 12장 파생클래스Tcpl 12장 파생클래스
Tcpl 12장 파생클래스
 
Java inner class
Java inner classJava inner class
Java inner class
 
Effective c++ chapter3, 4 요약본
Effective c++ chapter3, 4 요약본Effective c++ chapter3, 4 요약본
Effective c++ chapter3, 4 요약본
 
[0820 석재호]headfirst디자인패턴
[0820 석재호]headfirst디자인패턴[0820 석재호]headfirst디자인패턴
[0820 석재호]headfirst디자인패턴
 
[Swift] Types
[Swift] Types[Swift] Types
[Swift] Types
 
Python module
Python modulePython module
Python module
 
외계어 스터디 3/5 function and object
외계어 스터디 3/5   function and object외계어 스터디 3/5   function and object
외계어 스터디 3/5 function and object
 
DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)
 
Java extends
Java extendsJava extends
Java extends
 
5 6 1
5 6 15 6 1
5 6 1
 
Swift5 vs objective c
Swift5 vs objective cSwift5 vs objective c
Swift5 vs objective c
 
Scala type class pattern
Scala type class patternScala type class pattern
Scala type class pattern
 

Swift extensions