Collection 문서를 보면 Time Complexity 가 두개로 나온 부분이 많은데요, 예를들어 1) randomElement() 2) distance(from:to:) 3) count ✓ RandomAccessCollection = 효율적인 random-access index 순회를 지원하는 콜렉션 ✓ BidirectionalCollection = 양방향 (forward, backward) 순회를 지원하는 콜렉션 이렇게 두개의 콜렉션이 있는데, Expected Performance 에 잘 나와있는 것 처럼 bidirectional collection 는 전체 collection 을 순회해서 카운팅 해야하므로 O(1) 의 시간복잡도를 가질 수 없기 때문입니다. 각 콜렉션 문서에서도 차이를 잘 볼 ..
StoreKit Configuration File 의 기본 priceLocale 는 USD로 되어있다. 이걸 바꾸는 법을 알아보자. 참고로 Setting up StoreKit testing in Xcode 문서에 안나와있어서 이 글을 보고 알게됨! (wwdc 어딘가에 나와있을 것 같음) 파일 내부에 해당 세팅이 없고 다음과 같이 Editor 를 통해 변경한다. StoreKit Configuration File 선택 > Editor > DefaultStorefront 변경 그러면 StoreKit Configuration 아이템들의 price가 원화로 바뀌고 테스트 코드에서도 fetch 해온 product의 priceLocal / price가 원화기준으로 바뀐다. 이제 앱스토어커넥트에서 원화 기준으로 상품 ..
과거에 Continuations 를 이용해서 짰던 코드를 보는데 헷갈렸다.. @)@ 리마인드가 필요하군 우선 요 목차(?)가 머릿 속에 있어야한다. [1] 용어 기억 가끔 용어도 잘 생각이 안날 때가 있다,, [ Continuation ] 비동기 코드를 래핑해서 연속(continuation)을 만든다! 라고 기억하자 문서에서는 이렇게 표현한다. To create a continuation in asynchronous code, call the withUnsafeContinuation(function:_:) or withUnsafeThrowingContinuation(function:_:) function. [ CheckedContinuation vs UnsafeContinuation ] 잘 까먹는 주요원..
[SwiftUI] @Observable 매크로 (1) 에서 이어집니다. [ 요약 ] # 1. 예전에 뷰에서 썼던 프로퍼티 래퍼 @State, @Binding, @ObservedObject, @StateObject, @EnvironmentObject, @Enviroment iOS 17+ 부터는 4개만 쓰면 됨 @State, @Binding, @Bindable (NEW), @Enviroment # 2. ObservableObject 가 Observale 매크로로 대체되고 뷰에서 프로퍼티 래퍼로 쓰던 것은 다음과 같이 매핑됨 ✓ @ObservedObject ----> 안써도 됨 ㄴ 하지만 텍스트 필드처럼 Binding을 넘겨줘야하는 경우는 @Bindable ✓ @StateObject ----> @State ✓..
Swift 5.9 부터 Observable macro 를 사용할 수 있습니다. ✓ WWDC 23 > Discover Observation in SwiftUI ✓ Managing model data in your app / Migrating from the Observable Object protocol to the Observable macro ✓ Observation ✓ 구현 코드 WWDC 만 보면 채워지지 않는 구멍이 정말 많습니다 .. 🙄 문서를 같이 보길 추천드립니다. 또한 Xcode 15 beta 5 에서 @Observable 을 사용하면 컴파일 에러가 납니다 저는 이거 보고 Xcode 앱 이름에 공백제거하고 컴파일 성공했음! https://developer.apple.com/forums/thr..
# self in a clousre 다음과 같은 경우 Strong Reference Cycle (Retain Cycle) 이 발생한다. class SomeViewController: UIViewController { var someClosure: (() -> Void)? deinit { print("deinit") } override func viewDidLoad() { super.viewDidLoad() self.someClosure = { print(self) } } } 그래서 클로져 캡쳐리스트를 작성한다. class SomeViewController: UIViewController { var someClosure: (() -> Void)? deinit { print("deinit") } overri..
VisionOS App 직접 만들어보고 싶은데, Mac OS 14 beta 가 애플실리콘 밖에 없네요...😭 (download에도 download/all 에도 없음...없어..없어..) 저의 개인 맥이 인텔맥이여서 Mac OS 14 beta + Xcode 15 beta 조합을 할 수 없고... 그로 인해 우선 WWDC를 보면서 대충 정리를 해두고 언젠가 해보려고합니다... ---- > 헉 MacOS 13.4 에서도 Xcode 15 beta 가능합니다 🥹 ---- > 근데 Xcode 15.2 beta 에서 시뮬을 다운 못받는 군요 - VisionOS 문서 - WWDC > Spatial Computing 세션 모음 - Creating your first visionOS app - Interacting wit..
GridItem 을 만들 때 GridItem.Size 를 세팅해야한다. Size 옵션 중, 자주 헷갈리는 adaptive와 flexible 을 정리! public enum Size { /// A single item with the specified fixed size. case fixed(CGFloat) /// A single flexible item. /// /// The size of this item is the size of the grid with spacing and /// inflexible items removed, divided by the number of flexible items, /// clamped to the provided bounds. case flexible(minimu..
Swift-Collections 패키지가 나오고 다른 언어에는 있지만 Swift 에는 없어서 직접 구현해야했던 자료구조들 (deque, heap..) 이 제공되고 있다. [Swift Collections] deque 에 이어서 heap 을 살펴보자. 마찬가지로 이미 해당 자료구조를 내장 모듈로 제공하던 python 과 함께 살펴보자. [1] python 의 heap python은 heap 과 PriorityQueue (heap을 통해 구현) 를 모두 제공한다. # heap ✓ 파이썬의 heap은 min heap 이다. (min heap = 모든 부모 노드가 자식보다 작거나 같은 값을 갖는 이진 트리) ✓ 즉 모든 k에 대해 heap[k]
문서를 보면 Dictionary 의 subscript 로 세개가 구현되어있다. ✓ subscript(Key) -> Value? // get set ✓ subscript(Key, default _: () -> Value) -> Value // get set ✓ subscript(Dictionary.Index) -> Dictionary.Element // get 3번째처럼 key-based subscript 가 아니라 index-based subscript 도 있는 줄 몰랐는데, 정리해두자! [1] subscript(Key) -> Value? - 문서 - 코드 구현 var responseMessages = [200: "OK", 403: "Access forbidden", 404: "File not found..
- Total
- Today
- Yesterday
- PencilKit
- 플러터 얼럿
- 장고 Custom Management Command
- Flutter Text Gradient
- flutter deep link
- DRF APIException
- Django Heroku Scheduler
- Flutter Spacer
- Django FCM
- SerializerMethodField
- Sketch 누끼
- 장고 URL querystring
- Flutter 로딩
- flutter dynamic link
- flutter 앱 출시
- Flutter Clipboard
- ribs
- Python Type Hint
- ipad multitasking
- Django Firebase Cloud Messaging
- Flutter getter setter
- drf custom error
- 플러터 싱글톤
- github actions
- flutter build mode
- Dart Factory
- cocoapod
- METAL
- 구글 Geocoding API
- Watch App for iOS App vs Watch App
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |