TIL25 ✨

YaR Lab·2023년 5월 28일
0

TIL✨

목록 보기
15/135
post-thumbnail

23.05.26

parameter 반환값 --> 의존
property ---> 연관

enum assciated value

enum Barcode: Hashable {
    case upc(Int, Int, Int, Int)
    case quCode(String)
}

var productBarcodes: [Barcode: String] = [.upc(8, 10, 102, 1234): "toy",
.upc(1, 2, 3, 4): "toy2", .quCode("ABCDE"): "Banana"]

같은 케이스에대하여 다른 연관값으로 접근할 수 있다.

프로퍼티 옵저버

메서드를 통한 데이터의 전달

alert

0개의 댓글