일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ios
- Xcode
- uiscrollview
- RxCocoa
- ribs
- Protocol
- UITextView
- 클린 코드
- uitableview
- UICollectionView
- 스위프트
- Observable
- rxswift
- map
- Clean Code
- swift documentation
- SWIFT
- clean architecture
- Human interface guide
- Refactoring
- swiftUI
- 애니메이션
- 리펙터링
- HIG
- 리펙토링
- tableView
- 리팩토링
- combine
- collectionview
- MVVM
- Today
- Total
목록iOS 기본 (SwiftUI) (55)
김종권의 iOS 앱 개발 알아가기
목차) SwiftUI의 기본 - 목차 링크 ImagePaint 란? ImagePaint는 이미지를 격자 무늬로 여러개 그릴때 사용하며, ShapeStyle를 준수하고 있는 형태 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct ImagePaint : ShapeStyle { public var image: Image public var sourceRect: CGRect public var scale: CGFloat public init(image: Image, sourceRect: CGRect = CGRect(x: 0, y: 0, width: 1, height: 1), scale: CGFloat = 1) } ..
목차) SwiftUI의 기본 - 목차 링크 ScaledShape, RotatedShape, OffsetShape 3가지 모두 인자로 shape를 넣고, 두번째 파라미터에 scale, angle, offset을 넣어서 도형들을 편리하게 사용할 수 있는 구조체 ex) ScaledShape(shape:scale:) @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct ScaledShape : Shape where Content : Shape { public var shape: Content public var scale: CGSize public var anchor: UnitPoint @inlinable public..
목차) SwiftUI의 기본 - 목차 링크 Path 사용 방법 2D 선과 면을 그릴때 사용 move(to:) 메소드를 통해 시작점을 정하고, addLine(to:)를 통해 선을 그림 struct ContentView: View { var body: some View { Path { path in path.move(to: CGPoint(x: 100, y: 100)) path.addLine(to: CGPoint(x: 100, y: 200)) path.addLine(to: CGPoint(x: 200, y: 200)) } } } 사각형 그리기 struct ContentView: View { var body: some View { Path { path in path.move(to: CGPoint(x: 100, y..
목차) SwiftUI의 기본 - 목차 링크 도형들은 모두 Shape를 준수 대표적인 예로 Rectangle을 보면 Shape를 준수 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct Rectangle : Shape { public func path(in rect: CGRect) -> Path @inlinable public init() public typealias Body } Shape는 내부적으로 Animatable을 준수하고 있는 형태 Shape는 path라는 메소드가 있는데, 이 메소드에서 특정 도형을 그리는 형태 Shape, Animatable 관련 개념은 이전 포스팅 글 참고 @available(..
목차) SwiftUI의 기본 - 목차 링크 GeometryEffect 개념 위치를 변경해주는 이펙트 형태를 갖고있는 프로토콜 effectValue 메소드에서 CGAffineTransform과 같은 위치 관련 변환하는 코드를 넣고 리턴 GeometryEffect라는 프로토콜을 준수하는 struct를 만들고, 사용하는쪽에서 .modifier()와 같은 곳에 주입하여 사용 main thread에서 위치를 보간할때마다(=애니메이션이 적용될때마다) 계속 불리는 메소드가 effectValue @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) public protocol GeometryEffect : Animatable, ViewModifier where S..
목차) SwiftUI의 기본 - 목차 링크 Angle SwiftUI 내부적으로 정의한 구조체 Angle은 반지름(radians)와 각도 degrees를 가지고 있는 형태 Angle은 뒤에서 알아볼 rotationGesture, rotationEffect와 같은 곳에서 사용 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct Angle { public var radians: Double @inlinable public var degrees: Double @inlinable public init() @inlinable public init(radians: Double) @inlinable public init(d..
목차) SwiftUI의 기본 - 목차 링크 Shape 2D 모양의 뷰를 의미하는 프로토콜 (Circle, Capsule, Ellipse, ... 등) Shape 프로토콜 형태 path(in:)->Path: shape의 형태를 Path로 리턴 role: 모양을 채우는 스타일을 정의하며, 결합 모양(composite shape)과 같은 것을 만들때 이 프로퍼티를 재정의하여 사용 default implementation이 존재 - ShapeRole.fill이 있고 stroke와 separator가 있는 타입 @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) public protocol Shape : Animatable, View { func path(..
목차) SwiftUI의 기본 - 목차 링크 Transition 뷰를 보여질때와 제거할때의 애니메이션 주의: Transition 의미는 뷰를 이동할때의 개념보다는, 뷰를 보여지게할때와 사라지게할때의 애니메이션 개념으로 이해 뷰에 .transition(_:)으로 선언하여 사용이 가능 .transition(_:)에 들어가는 인수는 AnyTransition AnyTransition 위에서 알아봤듯이 .transition(_:) 인수에 들어가는 값 /// A type-erased transition. @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct AnyTransition { } AnyTransition은 exte..