iOS
-
RelativeDateTimeFormatter RelativeDateTimeFormatter | Apple Developer Documentation A formatter that creates locale-aware string representations of a relative date or time. developer.apple.com extension Date{ var relativeTime_abberiavted: String{ let formatter = RelativeDateTimeFormatter() formatter.unitsStyle = .full // 지역 설정하면 그 나라 언어로 상대시간을 표시 formatter.locale = Locale(identifier: "ko_KR") re..
[Swift] RelativeDateTimeFormatter(상대시간)RelativeDateTimeFormatter RelativeDateTimeFormatter | Apple Developer Documentation A formatter that creates locale-aware string representations of a relative date or time. developer.apple.com extension Date{ var relativeTime_abberiavted: String{ let formatter = RelativeDateTimeFormatter() formatter.unitsStyle = .full // 지역 설정하면 그 나라 언어로 상대시간을 표시 formatter.locale = Locale(identifier: "ko_KR") re..
2023.11.20 -
Array (Struct) 순서가 지정된 무작위 액세스 collection Array | Apple Developer Documentation An ordered, random-access collection. developer.apple.com 배열은 앱에서 가장 많이 사용되는 데이터 타입 중 하나 앱의 데이터를 구성할 때 배열을 사용 특히 배열을 사용하여 단일 유형의 element, 즉 배열의 element 유형을 보유 배열은 Int형부터 String, Class까지 모든 종류의 element를 저장 가능 예전 포스팅 [Swift] 배열 참조 : Swift 스위프트 프로그래밍 3판 Swift 5, 저자 야곰 (한빛미디어) , The Swift Programming Language Swift 5.6 E..
[Swift] 공식문서 파헤치기 (Array, Set, Dictionary)Array (Struct) 순서가 지정된 무작위 액세스 collection Array | Apple Developer Documentation An ordered, random-access collection. developer.apple.com 배열은 앱에서 가장 많이 사용되는 데이터 타입 중 하나 앱의 데이터를 구성할 때 배열을 사용 특히 배열을 사용하여 단일 유형의 element, 즉 배열의 element 유형을 보유 배열은 Int형부터 String, Class까지 모든 종류의 element를 저장 가능 예전 포스팅 [Swift] 배열 참조 : Swift 스위프트 프로그래밍 3판 Swift 5, 저자 야곰 (한빛미디어) , The Swift Programming Language Swift 5.6 E..
2023.11.11 -
UISceneDelegate Scene 내에서 발생하는 수명 주기(Life Cycle) 이벤트에 응답하는 데 사용하는 핵심 방법 UISceneDelegate | Apple Developer Documentation The core methods you use to respond to life-cycle events occurring within a scene. developer.apple.com Connecting and disconnecting the scene scene(_:willConnectTo:options:) : Delegate에 앱의 Scene을 추가하는 것을 알림 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, opt..
[Swift] UISceneDelegateUISceneDelegate Scene 내에서 발생하는 수명 주기(Life Cycle) 이벤트에 응답하는 데 사용하는 핵심 방법 UISceneDelegate | Apple Developer Documentation The core methods you use to respond to life-cycle events occurring within a scene. developer.apple.com Connecting and disconnecting the scene scene(_:willConnectTo:options:) : Delegate에 앱의 Scene을 추가하는 것을 알림 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, opt..
2023.11.09 -
Frame과 bounds에 대해 알아보기 전 CGPoint, CGSize, CGRect에 대해 알아야 한다. CGPoint : 2차원 좌표계의 점을 포함하는 Struct CGPoint | Apple Developer Documentation A structure that contains a point in a two-dimensional coordinate system. developer.apple.com CGSize : width와 height의 값 CGSize | Apple Developer Documentation A structure that contains width and height values. developer.apple.com CGRect : 사각형(Rectangle)의 위치와 크기를 ..
[Swift] frame vs boundsFrame과 bounds에 대해 알아보기 전 CGPoint, CGSize, CGRect에 대해 알아야 한다. CGPoint : 2차원 좌표계의 점을 포함하는 Struct CGPoint | Apple Developer Documentation A structure that contains a point in a two-dimensional coordinate system. developer.apple.com CGSize : width와 height의 값 CGSize | Apple Developer Documentation A structure that contains width and height values. developer.apple.com CGRect : 사각형(Rectangle)의 위치와 크기를 ..
2023.10.28 -
replay : Observable이 항목을 방출하기 시작한 후 구독하더라도 모든 Observer가 동일한 방출 순서를 볼 수 있도록 보장 let helloMention = PublishSubject() let bird = helloMention.replay(1) // 개수 bird.connect() helloMention.onNext("1. Hello") helloMention.onNext("2. Hi") bird.subscribe(onNext: { print($0) // 2. Hi }) .disposed(by: disposeBag) helloMention.onNext("3. How are you") // 지나고 나면 무조건 출력 // 2. Hi // 3. How are you replayAll: 모든..
[RxSwift] TimeBasedOperatorreplay : Observable이 항목을 방출하기 시작한 후 구독하더라도 모든 Observer가 동일한 방출 순서를 볼 수 있도록 보장 let helloMention = PublishSubject() let bird = helloMention.replay(1) // 개수 bird.connect() helloMention.onNext("1. Hello") helloMention.onNext("2. Hi") bird.subscribe(onNext: { print($0) // 2. Hi }) .disposed(by: disposeBag) helloMention.onNext("3. How are you") // 지나고 나면 무조건 출력 // 2. Hi // 3. How are you replayAll: 모든..
2023.10.03 -
startwith : 초기 값을 받는지 여부, 우선순위로 맨 앞에 Element가 추가되고 위치의 제약을 받지 않음 let yellow = Observable.of("a", "b", "c") yellow .startWith("Teacher") .subscribe(onNext: { print($0) }) .disposed(by: disposeBag) // Teacher // a // b // c concat : Observable들을 연결 let yellow1 = Observable.of("a", "b", "c") let teacher1 = Observable.of("Teacher") let line = Observable .concat([teacher1, yellow1]) line.subscribe(on..
[RxSwift] Combine Operatorstartwith : 초기 값을 받는지 여부, 우선순위로 맨 앞에 Element가 추가되고 위치의 제약을 받지 않음 let yellow = Observable.of("a", "b", "c") yellow .startWith("Teacher") .subscribe(onNext: { print($0) }) .disposed(by: disposeBag) // Teacher // a // b // c concat : Observable들을 연결 let yellow1 = Observable.of("a", "b", "c") let teacher1 = Observable.of("Teacher") let line = Observable .concat([teacher1, yellow1]) line.subscribe(on..
2023.10.03