iOS 프로그래밍 실무 14주차

2025. 6. 4. 14:29📱 모바일 프로그래밍/iOS 프로그래밍 실무

10주차 p.48

메타 타입: String. Type vs String.self

func decode<T>(_ type: T.Type, from data: Data) throws -> T where T: Decodable
let x : String.Type = String.self
//       메타 타입      메타타입 인스턴스 값

print(x, type(of:x)) // String String.Tyoe
print(String.self, type(of:String.self)) // String String.Type
pritn(Int.self, type(of:Int.self)) // Int Int.Type