static (1) 썸네일형 리스트형 [swift] 클래스(class) 클래스 (class) 구조체는 값 타입인 반면에, 클래스는 참조 타입이다. swift의 클래스는 다중 상속이 되지 않는다. class Sample { var mutableProperty: Int = 100 // 가변 프로퍼티 let immutableProperty: Int = 100 // 불변 프로퍼티 static var typeProperty: Int = 100 // 타입 프로퍼티 func instanceMethod() { // 인스턴스 메소드 print("instance method") } // 타입 메서드 static func typeMethod() { // 상속시 재정의 불가 타입 메서드 - static print("type method - static") } class func classMeth.. 이전 1 다음