일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 |
30 | 31 |
- combine
- ribs
- tableView
- rxswift
- MVVM
- Refactoring
- HIG
- Human interface guide
- 스위프트
- swiftUI
- 클린 코드
- 리펙토링
- SWIFT
- 리펙터링
- UITextView
- Observable
- RxCocoa
- UICollectionView
- map
- clean architecture
- 리팩토링
- Protocol
- uiscrollview
- Xcode
- Clean Code
- collectionview
- swift documentation
- ios
- uitableview
- 애니메이션
- Today
- Total
목록2022/10 (31)
김종권의 iOS 앱 개발 알아가기
목차) SwiftUI의 기본 - 목차 링크 *초록색 뷰를 파란색뷰 오른쪽 하단에 위치시키는 방법? -> 아래에서 알아볼 GeomettryReader를 사용 GeometryReader, GeometryProxy 란? 뷰의 Container라고 생각하면 되고, 인수로 사용할 수 있는 GeometryProxy가 존재 GeometryProxy란 좌표와 사이즈 값을 가지고 있는 역할 즉, 컨테이너뷰에 관련하여 좌표를 구하고 싶을때나 컨테이너뷰의 크기를 알고 싶은 경우, proxy로 사용 struct ContentView: View { var body: some View { VStack { Text("Jake iOS 앱 개발 알아가기") GeometryReader { proxy in } } } } GeometryP..
목차) SwiftUI의 기본 - 목차 링크 Gradients (Linear, Angular, Radial) 이전 포스팅 글, Swift에서 알아본 CAGradientLayer와 개념은 동일하며, SwiftUI에서는 각 속성이 더 직관적인 이름으로 변경 axial(linear) -> Linear radial(circle) -> Radial conic(sweep) -> Angular LinearGradient 요소 색상 입력 - colors 시작 지점 - startPoint 종료 지점 - endPoint @available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *) @frozen public struct LinearGradient : ShapeStyle, Vie..
목차) 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..