Swift44 [TCA] day 1 TCA에서 Alert와 Dialog를 다루기. GettingStarted-AlertsAndConfirmationDialogs 전체 코드 import ComposableArchitecture import SwiftUI private let readMe = """ This demonstrates how to best handle alerts and confirmation dialogs in the Composable \ Architecture. The library comes with two types, `AlertState` and `ConfirmationDialogState`, which are data \ descriptions of the state and actions of an alert or dialog. These types can be constructed in \ reducers to control whether.. 2024. 4. 19. [iOS] Weak Dictionary 다이브 Weak Dictionary? Does iOS have Garbage Collection? 개요 WeakDictionary를 어떻게 만들까요에 대한 궁금중에서 출발합니다. Dictionary에 대한 기초 보통 우리가 Dictionary를 만들 때 다음과 같이 작성합니다. 많이 사용해보신 분들은 아시겠지만 Dictionary의 Key값이 되기 위한 조건은 Hashable 이라는 protocol을 만족해야 합니다. Hashable이라는 Protocol은 ==의 Operator와 hash(into:)의 매서드를 구현을 통해 완성합니다. 자세한 설명은 Hashable 문서를 참조하시면 좋을 것 같습니다. Collection Type 우리는 Dictionary를 보기 전 스위프트의 Collection Types에.. 2024. 2. 16. [UIKit] UICalendarview 공식문서 해쳐보기 Today I Learned UICalendarView UICalendarview 란 무엇일까? 날짜별 장식이 있는 일정관리를 표시하고, 단일 날짜 또는 여러 날짜를 사용자가 선택할 수 있도록 제공하는 보기입니다. A view that displays a calendar with date-specific decorations, and provides for user selection of a single date or multiple dates. Overview 일정관리 보기를 사용하여 사용자가 사용자 정의한 장식을 사용하여 추가 정보(예: 예약된 이벤트)가 있는 특정 날짜를 표시할 수 있습니다. 또한 일정관리 보기를 사용하여 하나의 특정 날짜, 여러 날짜 또는 날짜가 없는 날짜를 선택할 수 있습니다. .. 2024. 2. 5. [UIKit] 단방향 의존관계에서 상위 Coordinator에게 메시지를 전달하는 방법 단방향 의존관계에서 상위 Coordinator에게 메시지를 전달하는 방법 단방향 코디네이터에서 가장 상위뷰 코디네이터에게 메시지를 전달하고 싶습니다. 어떻게 해결해야 할까요? 이부분에 대해서 많은 고민을 했습니다. NotificationCenter Coordinator에게 NotificationCenter를 통해서 메시지를 전달하는 방법이 있었습니다. Notification을 호출하여 가장 상위뷰에서 Coordinator Reset작업을 실행하는 방법을 고안했습니다. Delegate NotificatonCenter를 활용하지 않는 방식인 Delegate를 활용할 수도 있습니다. 상위 RootCoordinator에서 Shared 모듈에 Delegate를 구현함으로서 여태 생성했던 child Router를 .. 2024. 2. 2. [UIKit] Coordinator with Flow에 관하여 Coordinator 트러블 슈팅 개요 뷰 게층은 위에서 아래로 떨어집니다. 이것이 subViews를 통해서 일수도 있고, NavigationController를 통해서 Push 혹은 ViewController의 Present방식을 통해서 Depth가 깊어집니다. 우리는 때때로 순차적으로 ViewController를 해제하여 Depth를 줄이는 것이 아닌 바로 줄이고 싶은 경우가 있습니다. 이럴 때 어떤 방식을 활용하는것이 좋을까에 대해서 고민해본점을 설명하려 합니다. Coordinator를 구현할 때 Flow라는 변수를 구현 코디네이터 하나가 꼭 하나의 뷰컨트롤러만 만들어야 할까 부터 시작합니다. 어떤 경우는 순서가 보장되었을 때도 있습니다. 예를 들어서 글쓰기와 사람을 태그하는 화면은 순차적으로 무조.. 2024. 2. 2. [UIKit] Nested Section 을 포함한 CollectionView 만들기 # NestedCollectionView 만들기 목표 화면 1. diffableDataSource 와 섹션 layout 만들기 섹션에 따른 각기 다른 레이아웃 구상 private var dataSource: UICollectionViewDiffableDataSource! func make(customCollectionViewSection section: CustomCollectionViewSection, env: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? { switch section { // Top Section case .top: let itemSize = NSCollectionLayoutSize(widthDimension: .frac.. 2024. 1. 25. 이전 1 2 3 4 5 6 7 8 다음