일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 클린 코드
- MVVM
- 애니메이션
- Protocol
- RxCocoa
- Refactoring
- ios
- combine
- 리펙터링
- Clean Code
- SWIFT
- tableView
- rxswift
- uitableview
- UITextView
- 리팩토링
- Xcode
- swiftUI
- 리펙토링
- uiscrollview
- Human interface guide
- 스위프트
- UICollectionView
- swift documentation
- Observable
- map
- clean architecture
- ribs
- HIG
- collectionview
- Today
- Total
목록swiftUI (160)
김종권의 iOS 앱 개발 알아가기
SwiftUI의 Binding 바인딩이란 A가 변경될 때 같이 B도 변경해주어야하는 경우, A와 B를 바인딩 해놓으면 A가 변경되었을때 B는 자동으로 변경되게끔 하는 기법을 의미 SwiftUI에서의 바인딩은 property wrapper 형태로 존재 구체적인 @Binding 개념은 이전 포스팅 글 참고 Binding 인터페이스 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen @propertyWrapper @dynamicMemberLookup public struct Binding { public var transaction: Transaction public init(get: @escaping () -> Value, set: @e..
1. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - 개념 2. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - UI 구현 방법 3. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - UIKit에서 다이나믹 아일랜드 적용 방법 예제를 위한 UIKit 프로젝트 생성 Interface > SwiftUI가 아닌 Storyboard 선택 info.plist에서 Live Activity 활성화 Xcode에서 target 선택 Widget Extension 추가 생성된 것 중 필요한 두 가지 파일 확인 JakeBundle: body가 있으며 여러 위젯을 노출할때 사용되는 컨테이너..
목차) Combine - 목차 링크 Catch(_:) 에러가 발생할때 해당 에러에 대한 catch에 걸리면 catch에서 리턴한 데이터만 방출하고 위에있던 남은 데이터는 무시 struct MyError: Error {} let _ = [1,2,-3,4,5].publisher .tryMap { guard $0 > 0 else { throw MyError() } return $0 } .catch { error in [9,8,7].publisher } .sink( receiveCompletion: { print("Completion: \($0)") }, receiveValue: { print("Value:", $0) } ) // Value: 1 // Value: 2 // Value: 9 // Value: 8 ..
1. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - 개념 2. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - UI 구현 방법 3. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - UIKit에서 다이나믹 아일랜드 적용 방법 * Live Activity 기본적인 세팅 방법은 이전 포스팅 글인, 1번 글 참고 Dynamic Island의 UI 구현 방법 1번글에서 자동으로 생성된DynamicIslandWidgetLiveActivity코드 import ActivityKit import WidgetKit import SwiftUI struct DynamicIslandWid..
1. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - 개념 2. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - UI 구현 방법 3. Live Activity (ActivityKit, Dynamic Island, 잠금 화면) - UIKit에서 다이나믹 아일랜드 적용 방법 Live Activity 개념 실시간 현황을 Dynamic Island나 잠금화면 또는 아이폰 화면에 보여주기 위해 나온 개념 Live Activity는 iPhone에서만 가능 Live Activity 특징 Live Activity 업데이트는 오로지 ActivityKit으로 접근해야 가능 최대 8시간 지속 가능 (8시간 경과 시 시스템에 의해 자..
목차) Combine - 목차 링크 Combining 연산자 * 스트림에서 방출되는 2개 이상의 요소들을 묶어서 방출하는 방법 예제에 사용할 스트림 2개 준비) PassthroughSubject는 downstream subscribers에게 값을 broadcast하는 subject 값을 저장하고 있지는 않고 단순히 값을 토스 해주는 역할 RxSwift의 PublishSubject와 동일 (구체적인 개념은 이전 포스팅 글 참고) let passthroughSubject1 = PassthroughSubject() let passthroughSubject2 = PassthroughSubject() combineLatest(_:_:) 두 스트림 모두 메시지를 받았을때 이벤트 방출 해당 연산자에서 이전 값을 기억..
목차) Combine - 목차 링크 Selecting 연산자 * Combine에서 제공하는 Selecting 연산자는 기존 Swift에서 제공하는 연산자의 인터페이스와 동일하게 설계되어 사용하기 쉽도록 구현 first() [1,2,3,4,5].publisher .first() .sink { print($0) } // 1 last() [1,2,3,4,5].publisher .last() .sink { print($0) } // 5 tryFirst 조건에 해당하는 firrst를 만나기 전까지 throw가 발생 안하면 에러 x struct SomeError: Error {} [1,2,3,4,5].publisher .tryFirst(where: { guard $0 != 3 else { throw SomeErro..
목차) Combine - 목차 링크 Matchging 연산자 * Combine에서 제공하는 Matching 연산자는 기존 Swift에서 제공하는 연산자의 인터페이스와 동일하게 설계되어 사용하기 쉽도록 구현 contains(where:) where 클로저 조건에 따라 Bool 반환 [1,2,3,4,5].publisher .contains(where: { $0 == 3 }) .sink { print($0) } // true tryContains(where:) contains는 true를 반환하면 이후 값에 관해서 체크하지 않음을 주의 (아래에서 true를 먼저 반환하므로 throw 발생 x) [1,2,3,4,5].publisher .tryContains(where: { guard $0 != 5 else { ..