문서를 보면 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..
단위 테스트 8장~10장 (Part 3. 통합 테스트) / 11장 (Part 4. 단위테스트 안티패턴) 내용을 기반으로 하고 있습니다. 8장 통합 테스트를 하는 이유 # 통합테스트의 역할 통합테스트는 시스템이 프로세스 외부 의존성과 통합해 작동하는 방식을 검증한다. 단위테스트 - 도메인 모델 및 알고리즘 확인 통합테스트 - 컨트롤러 확인 // 외부의존성과 도메인 모델을 연결하는 코드를 확인 다시 한번 강조하지만, 모든 테스트는 도메인 모델과 컨트롤러 사분면에만 초점을 맞춰야한다. 단위테스트가 아닌 모든 테스트가 통합테스트에 해당한다. (단위테스트 = 단일 동작 단위를 검증하고, 빠르게 수행하고, 다른 테스트와 별도로 처리한다) # 다시 보는 테스트 피라미드 단위 테스트 - 유지보수성, 피드백 속도가 우수..
[ 이 글에서 다루는 내용 ] - actor 의 등장배경 - actor - nonisolated - global actor - main actor [1] actor 가 나오기 전에는? 예전에는 data race가 발생할 수 있다면 lock 이나 queue 를 추가 구현해줘야했다. 대충 data race 가 발생할 수 있는 상황을 만들고, Thread Sanitizer 를 켜고 돌려보자. class UserManager { static let shared = UserManager() private(set) var userName = "" private init() {} func updateUserName(to name: String) { print(Thread.current) userName = name ..
Sendable 문서와 WWDC 22 > Eliminate data races using Swift Concurrency 를 조합해서 재구성한 내용입니다. [1] Sendable = safe to share Sendable 프로토콜은 concurrencey 상황에서 안전하게 공유될 수 있는 타입을 나타냅니다. 즉 우리는 하나의 concurrency domain (또는 isolation domain)에서 다른 domain으로 sendable type을 안전하게 pass 할 수 있습니다. (data race를 만들지 않고) [2] Sendable 을 채택할 수 있는 타입 1. Value Types frozen struct or enumeration. 아래 사진에 나오는 Chicken 은 class인데 이를 ..
[1] TaskGroup과 ThrowingTaskGroup ✓ TaskGroup : A group that contains dynamically created child tasks. (자세한 설명은 이 글 5번 참고) taskGroup을 만드려면 withTaskGroup(of:returning:body:) 를 호출. ✓ ThrowingTaskGroup : A group that contains throwing, dynamically created child tasks. throwing task group을 만드려면 withThrowingTaskGroup(of:returning:body:) 를 호출 [2] 사용예제 2.1 간단한 병렬 실행을 위해 async-let syntax 를 쓰다가 확장이 필요할 때 ..
- Total
- Today
- Yesterday
- 장고 URL querystring
- Dart Factory
- PencilKit
- Flutter Spacer
- ipad multitasking
- SerializerMethodField
- Flutter 로딩
- Python Type Hint
- flutter build mode
- DRF APIException
- Flutter Text Gradient
- 구글 Geocoding API
- Sketch 누끼
- Django Heroku Scheduler
- Watch App for iOS App vs Watch App
- Django Firebase Cloud Messaging
- flutter dynamic link
- flutter deep link
- 장고 Custom Management Command
- 플러터 싱글톤
- flutter 앱 출시
- Flutter getter setter
- ribs
- Flutter Clipboard
- 플러터 얼럿
- METAL
- cocoapod
- Django FCM
- github actions
- drf custom error
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |