[1] Overriding Build Settings for a Target 타겟이 프로젝트 빌드세팅을 상속받는데, 타겟의 특정 값을 직접 수정하면 오버라이딩하는 셈이 되어 해당 타겟만 설정을 따로 가져갈 수 있다. 즉 프로젝트의 특정 값을 수정해도 타겟의 값은 따라서 안바뀌게 되는 것이다. 그리고 타겟의 빌드세팅에서 오버라이딩한 필드는 볼드체로 표시되는 것 같ㄷ (Xcode 13.2 사용 중) 나의 설명보다.. Working with Targets 의 Overriding Build Settings for a Target 부분을 보면 훨씬 명확하다. A target inherits the project’s build settings. Although most developers seldom need to..
Swift Docs > Advanced Operators > Operator Methods, Custom Operators 내용을 기반으로 하고 있습니다. [1] Operator Methods Class와 Structure은 existing operators 에 대해 그들 자신의 구현을 제공할 수 있습니다. 이것은 'existing operators 를 overloading 한다' 라고 말할 수 있습니다. existing operators 목록은 Operator Declarations 문서에서 볼 수 있습니다. 하지만 모든 operator을 overload 할 수 있는 것은 아닙니다. 1️⃣ default assignment operator (=) 2️⃣ ternary conditional operato..
Swift Docs의 - Advanced Operators > Result Builders - Attributes > resultBuilder 를 기반으로 하는 내용입니다. [1] Result Builder 란? A result builder is a type you define that adds syntax for creating nested data, like a list or tree, in a natural, declarative way. A result builder is a type that builds a nested data structure step by step. result builder 는 선언적인 방식 (step by step으로 코드를 작성할 수 있는 방식) 으로 nested d..
10진수가 2진수로 어떻게 표현되는 지 확인하고 싶을 때 유용한 String 이니셜라이저가 있습니다. init(_:radix:uppercase:) 입니다. radix 기본 값이 10인데 2~36 까지 원하는 값을 넣어주며 사용할 수 있습니다. 저는 2진수로 변환하고 싶어서 radix를 2로 설정해주고 사용하겠습니다. ➕ 참고로 String뿐만아니라 Int도 radix를 받을 수 있는 이니셜라이저를 가지고 있습니다. (참고: init(_:radix:)) # Positive 4를 이진수로 출력해볼까요? 8-bit unsigned integer 타입인 UInt8을 사용해주었습니다. let positiveValue: UInt8 = 4 print(String(positiveValue, radix: 2)) // 1..
Swift Docs의 Implicitly Unwrapped Optionals 와 Unowned References and Implicitly Unwrapped Optional Properties 에 나오는 내용을 기반으로 하고 있습니다. [1] Implicitly Unwrapped Optional 이란? '암묵적으로(암시적으로) 언래핑한 옵셔널' 이라는 용어그대로 옵셔널이지만 언래핑하지 않고 사용할 수 있는 옵셔널을 말합니다. Optional을 만들 때 question mark(물음표)를 사용했다면 (ex. String?) Implicitly Unwrapped Optional을 만들 때는 exclamation point(느낌표) 를 사용해주면 됩니다. (ex. String!) 아래의 예제는 optiona..
Swift Docs > Opaque Types 에 나오는 내용입니다! Shape 라는 프로토콜이 있다고 해봅시다! protocol Shape { func draw() -> String } Triangle, Square처럼 이 프로토콜을 컨펌하는 타입을 만들 수 있습니다. struct Triangle: Shape { var size: Int func draw() -> String { var result: [String] = [] for length in 1...size { result.append(String(repeating: "*", count: length)) } return result.joined(separator: "\n") } } let triangle = Triangle(size: 3) pr..
Swift Docs > Protocol > Protocol Composition 을 읽다가 새로 알게된 내용! protocol composition 은 one class type 을 포함할 수 있다고 합니다 😲 이는 required superclass를 명시할 때, 사용할 수 있습니다. In addition to its list of protocols, a protocol composition can also contain one class type, which you can use to specify a required superclass. protocol Named { var name: String { get } } class Location { var latitude: Double var longi..
Swift Docs의 Initialization 과 Extensions을 읽으며 알게 된 내용이다. Swift의 Structure은 자동으로 default initializer와 memberwise initializer를 가지게 된다. 다만 custom initializer를 따로 정의하지 않았을 때만!! 예제를 통해 살펴보자. struct Size { var width = 0.0, height = 0.0 } struct Point { var x = 0.0, y = 0.0 } struct Rect { var origin = Point() var size = Size() } let defaultRect = Rect() let memberwiseRect = Rect(origin: Point(x: 2.0, y..
마틴 파울러 > Mocks Aren't Stubs 글 내용이 좋아서 기록합니다. 제가 편한 말(?) 로 바꾼 부분이 많아서 원글을 읽어보시길 추천드려요! # Regular Tests 아래는 일반적인 JUnit 테스트입니다. 스펙은 아래와 같습니다. 주문을 처리할 만큼의 상품이 창고에 있으면 주문이 완료되고 창고의 상품 수량은 해당 수량만큼 감소합니다. 반면 창고에 제품이 충분하지 않으면 주문이 채워지지 않고 창고에 아무 일도 일어나지 않습니다. public class OrderStateTester extends TestCase { private static String TALISKER = "Talisker"; private static String HIGHLAND_PARK = "Highland Park"..
[DI] DI Container, IOC Container 개념과 예제 에서 간단하게 Property Wrapper 를 사용했었는데요, Swift Docs > Properties > Property Wrappers 에서 더 자세한 내용들을 알게 되어서 정리합니다 ✏️ # Property Wrapper 전제조건 Property Wrapper 는 Swift 5.1 에 추가되었고 local stored variable 에만 사용가능합니다 (global variable 또는 computed variable 에서 사용불가) # Property Wrapper 정의하기 Property Wrapper 를 정의하려면 wrappedValue property 를 정의한 structure, enumeration, class ..
- Total
- Today
- Yesterday
- Flutter 로딩
- ribs
- Django Heroku Scheduler
- flutter build mode
- Dart Factory
- flutter 앱 출시
- Flutter getter setter
- DRF APIException
- flutter dynamic link
- Django Firebase Cloud Messaging
- Flutter Text Gradient
- PencilKit
- METAL
- Sketch 누끼
- Python Type Hint
- flutter deep link
- Watch App for iOS App vs Watch App
- Django FCM
- 장고 URL querystring
- github actions
- Flutter Clipboard
- 플러터 얼럿
- 플러터 싱글톤
- ipad multitasking
- Flutter Spacer
- SerializerMethodField
- 구글 Geocoding API
- cocoapod
- 장고 Custom Management Command
- 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 |