본문 바로가기
Property Wrapper Property Wrapper A property wrapper adds a layer of separation between code that manages how a property is stored and the code that defines a property. For example, if you have properties that provide thread-safety checks or store their underlying data in a database, you have to write that code on every property. When you use a property wrapper, you write the management code once when you define.. 2022. 4. 28.
Xcode 버전별 지원되는 SDK 최소 요구 사항 및 지원되는 SDK Xcode 버전필요한 최소 OS SDK아키텍처배포 대상시뮬레이터Swift Xcode 버전 필요한 최소 OS SDK 아키텍처 배포 대상 시뮬레이터 Swift Xcode 13.3 macOS Monterey 12 iOS 15.4 macOS 12.3 tvOS 15.4 watchOS 8.5 DriverKit 21.4 x86_64 armv7 armv7s armv7k arm64 arm64e arm64_32 iOS 9~15.4 iPadOS 13~15.4 macOS 10.9~12.3 tvOS 9~15.4 watchOS 7~8.5 DriverKit 19~21.4 iOS 12.4~15.4 tvOS 12.4~15.4 watchOS 7~8.5 Swift 4 Swift 4.2 Swift 5.6.. 2022. 4. 28.
self vs Self 소문자 self 인스턴스 자체 접근 시 사용되는 참조값 self는 참조 타입 value type에서의 self는 stack영역에 존재하는 instance를 가리키는 형태 reference type에서의 self는 heap 영역에 존재하는 instance를 가리키는 형태 대문자 Self Self는 type그 자체를 의미 -> 타입을 정의할때 사용 Self.self는 type object를 의미 -> 타입을 넘길때 사용 protocol 내부에서의 Self 의미: protocol 자신이 아닌, 자기 자신을 채택한 타입을 의미 Class에서의 Self 의미 : 해당 인스턴스의 타입 자체를 표현 참고자료 https://ios-development.tistory.com/600 2022. 4. 27.
RxSwift Operator : Map, FlatMap Map transform the items emitted by an Observable by applying a function to each item map은 이벤트를 바꾼다. E Type이벤트를 R Type이벤트로 바꾼다 map은 클로저에 연산 값을 리턴시킨다 observable로 부터 emit되는 item을 다른 타입으로 바꾸고 싶을때 map이 사용된다 FlatMap transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable 이벤트당 한 개의 새로운 Observable 시퀀스를 생성한다. 이렇게 생성된 여러개의 새로운 시퀀스를 하나의 .. 2022. 4. 18.
typealias, associatedtype typealias typealias란 타입에 붙일 수 있는 별칭 associatedtype associatedType 은 Protocol을 위한 Generic An associated type gives a placeholder name to a type that’s used as part of the protocol. 참고자료 https://docs.swift.org/swift-book/LanguageGuide/Generics.html https://woongsios.tistory.com/97 2022. 4. 15.
Strategy Pattern Strategy Pattern 이란? Strategy Pattern (전략 패턴)은 교환 가능한 객체들을 정의해두고 Strategy protocol을 이용하여 런타임에 설정하거나 변환하는 패턴 Object using a Strategy : Strategy protocol을 이용하는 객체 Strategy protocol : 모든 strategy가 반드시 구현해야 할 메서드들을 정의하고 있는 프로토콜 Strategies : Strategy 프로토콜을 준수하는 교환가능한 객체들 Strategy Pattern 예시코드 // MARK: - Strategy Protocol protocol MovieRatingStrategy { var ratingServiceName: String { get } func fetch(.. 2022. 4. 15.