일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- UICollectionView
- ribs
- 리펙토링
- swiftUI
- 리펙터링
- rxswift
- Human interface guide
- ios
- Clean Code
- MVVM
- 스위프트
- HIG
- UITextView
- clean architecture
- uitableview
- collectionview
- uiscrollview
- Observable
- 애니메이션
- tableView
- 리팩토링
- map
- Xcode
- SWIFT
- swift documentation
- Refactoring
- Protocol
- RxCocoa
- 클린 코드
- combine
- Today
- Total
목록ios (1095)
김종권의 iOS 앱 개발 알아가기

@dynamicMemberLookup 개념 컴파일 타임에 정의하지 않은 property에 대한 접근을 런타임에 처리하도록 해주는 역할 dynamic member lookup라고 명칭한 이유: 컴파일 타임이 아닌 런타임 기준으로(dynamic) 프로퍼티에 dot으로 접근(member lookup)한다는 의미 런타임에 접근하게 해주는데, 이 때는 dot으로 접근하게끔 하는 역할 @dynamicMemberLookup을 선언하면 subscript(dynamicMember key: String) -> String 필수 구현이 필요 ex) Person이라는 구조체에 @dynamicMemberLookup을 사용 의미: Person이라는 프로퍼티에 접근할 때, 이 인스턴스를 사용하는 쪽에서 런타임에 생성되는 프로퍼티에..

기초 지식) 초기화의 종류 1) memberwise init (struct only) struct에서 제공하는 초기화 방법이며, struct의 모든 property에 대해서 자동으로 internal 접근 제한자인 초기화가 생성 struct Person { var name: String var age: Int } let person = Person(name: "jake", age: 30) 2) designated init (class only) 해당 클래스에 의해 선언된 모든 property를 모두 초기화하고 적절한 super class의 init을 호출하여 super class까지 init 프로세스를 진행 Designated init은 그냥 "Designated"를 생략하여 그냥 init으로 사용 cla..

isMultipleTouchEnabled 개념 멀티 터치라는 것은 동시에 터치한다는 것이 아니고, 자기 자신의 뷰의 중복 터치를 막는다는 의미 isMultiTouchEnabled = true이면 오른손으로 aButton을 누른 상태에서 왼손으로 aButton을 누르면 선택이 가능 (isMultiTouchEnabled의 default값은 false) extension UIView { open var frame: CGRect open var bounds: CGRect open var center: CGPoint open var transform: CGAffineTransform ... open var isMultipleTouchEnabled: Bool // aButton은 안눌리고 bButton은 눌림 aB..

1. long press gesture와 애니메이션 - 드래그 구현 방법 (snapshotView, CGAffineTransform) 2. long press gesture와 애니메이션 - 드래그할때 다른 뷰 줄어들고, 해당 뷰 크게하기 (UIView.animate, CGAffineTransform, concatenating) 3. long press gesture와 애니메이션 - 드래그와 cornerRadius, shadow 효과 (CABasicAnimation) 4. long press gesture와 애니메이션 - UIStackView에 DragDrop 적용 (DragDropStackView 구현) 5. long press gesture와 애니메이션 - gesture 도중 화면 끝으로 가면 자동으로..

UICollectionView의 Drag & Drop UICollectionView에서 dragInteractionEnabled = true하면 drag & drop을 구현할 수 있고, dragDelegate, dropDelegate를 구현하면 데이터 처리가 가능 DragDropCollectionView 구현 방법은 이전 포스팅 글 참고 코드 Github drag할 때 특정 뷰만 보이게끔 하는 방법? 만약 cell을 타원 형태로 만들고 싶을 때, drag & drop을 하게되면 cell의 사각형 영역만큼 하얀색 영역이 생성됨 (이동시킬 때 보라색 바깥쪽에 cell의 하얀색 색상이 생성된 형태) UICollectionViewDragDelegate의 itemsForBeginning을 사용하면 쉽게 구현이 가..

@_implementationOnly 개념 일반적으로 AFramework가 BFramework를 의존하고 있을 때, AFramework 의존만해도 BFramework를 import하여 사용이 가능 하지만 Aframework를 사용하는 앱 입장에서, import를 안하면 BFrmaework의 모델 타입을 아예 모르게끔 하기 위해서 @_implementationOnly를 사용 // AFramework @_implementationOnly import BFramework @_implementationOnly를 사용하면 AFramework안에서 BFramework관련 타입을 리턴하거나, 프로퍼티로 갖거나, 파라미터로 갖을수 없게 컴파일 에러가 발생 (AFramework를 사용하는 입장에서 BFramework..

@_spi 개념 swift의 접근 제어자는 open, public, internal, fileprivate, private이 있지만 프레임워크 사이의 또 다른 접근 제어자가 존재 SPI(Swift Private Interface)도 외부에 노출할 인터페이스 제어가 가능 @_spi(Private) 키워드를 property, func, class 등 앞에 붙이면 이 것을 접근하려면 사용하는 쪽에서 @_spi(Private)으로 import해야 접근이 가능 접근제어자보다, @_spi(Private)우선순위가 더욱 커서 public으로 열어주어도 @_spi(Private) 없이 접근 불가 // Jake 프레임워크 @_spi(Private) public func myPrivateFunc() {} // Jake 프..

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..