Diffable Data Source? Diffable DataSource는 WWDC 19에 발표되었고, IOS 13 이상 부터 사용가능하다. TableView, CollectionView의 DataSource에서 개선된 것임으로 둘 다 적용이 가능하다. 변경된 Data를 적용해야 할 때 그냥 reloadData를 써버리거나, performBatchUpdates로 애니메이션 까지 신경쓰며 갱신을 해 줬지만, Diffable DataSource를 사용하면 첫 설정에 UI에 대한 설정 말고는 데이터가 변할 때 마다 apply만 해 주면 알아서 애니메이션 까지 자연스럽게 적용할 수 있다. 적용하기 먼저 결과 화면 먼저 스토리 보드를 사용해 collectionView를 추가했다. Diffable DataSour..
1. 프로젝트에 Firebase 추가 https://console.firebase.google.com/?hl=ko 로그인 - Google 계정 이메일 또는 휴대전화 accounts.google.com Firebase console에 들어가 프로젝트를 생성하고 설명을 따라가면 쉽게 프로젝트를 생성할 수 있다. GoogleService-Info.plist 를 프로젝트에 추가하고 2. Authentication에 사용할 로그인 제공업체 선택 새 제공업체 추가를 누르고 구글, 애플을 추가했다 3. 프로젝트에 애플 로그인 설정 먼저 프로젝트에 들어가 Target의 Signing&Capabillities 를 선택하면 Capaillity를 추가할 수 있는 버튼이 있다. 버튼을 누르고 Sign In with Apple..
참고한 유튜브 자료MVVM 아키텍처를 처음 공부했을 땐 RxSwift로 시작을 했었는데, Combine을 알고 나서 UIKit에서 Combine으로 MVVM을 할 수 있지 않을까 라는 생각에 찾아보고 시도해봤다.유튜브 예제는 통신 예제에 버튼을 누르면 랜덤한 글이 나오게 하는 것이고, 내가 한 건 로그인 화면을 구현한 것이다.프로젝트 세팅은 Storyboard로 진행했고 Combine을 제외한 라이브러리는 사용하지 않았다.간단한 로그인 회원가입 화면을 만들고 MVVM을 적용해봤다.final class SignInViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var signInButton: UIButton! ..
https://developer.apple.com/documentation/swiftui/view-styles View styles | Apple Developer Documentation Apply built-in and custom appearances and behaviors to different types of views. developer.apple.com Label, Button 등의 View에 스타일을 지정하거나 커스텀 할 수 있게 하는 것이 ViewStyle이다. Label을 예로 들면,,, 기본으로 Label의 style에는 4가지 정도가 있는데, 사용자가 커스텀 해서 스타일을 만들 수 있다. Custom Style을 만들기 위해서는 LabelStyle 프로토콜을 채택한 구조체를 만들면..
SwiftUI 에서 지도를 띄우기 위해서는 먼저 MapKit을 import 해야한다. Map(coordinateRegion:, interactionModes:, showsUserLocation:, userTrackingMode:, annotationItems:, annotationContent:) MapKit을 import 하면 지도를 보여주는 Map 을 사용해 View에 보여줄 수 있다. coordinateRegion: Binding 타입으로 지도가 표시될 위치와 지도의 zoom level을 초기화해 주입한다. MKCoordinateRegion(center:, span:) MKCoordinateRegion(center:, latitudinalMeters:, longitudinalMeters:) MKCo..
EventKit 달력, 미리알림 어플의 데이터에 접근 하여 이벤트를 생성, 검색, 편집을 할 수 있는 프레임워크. 먼저 사용하기 전, info.plist에 권한 체크를 받아야 한다. let status = EKEventStore.authorizationStatus(for: .event) switch status { case .notDetermined: //아직 권한 팝업 뜨기 전 let accessGranted = try await ekStore.requestAccess(to: .event) guard accessGranted else { throw ServiceError.accessDenied } case .restricted: throw ServiceError.accessRestricted case ..