NEULiee / iOS-App-Dev-Tutorials

Apple 개발자 홈페이지의 UIKit 튜토리얼을 보고 정리하는 repository 입니다.
0 stars 0 forks source link

5. Custom Views and Animation #9

Closed NEULiee closed 2 years ago

NEULiee commented 2 years ago
NEULiee commented 2 years ago

Examining Accessibility in Today

Examining Accessibility in Today

NEULiee commented 2 years ago

Creating a Progress View

Learned

  1. Create Relational Constraints

    • progress view 진행률 view는 백분율 표시 view, 완료되지 않은 미리 알림의 백분율을 표시하는 view, 다른 view의 레이아웃과 위치를 결정하는 container view와 같은 여러 하위 view로 구성된다.
    • UICollectionReusableView
  2. Customize the Appearance of the Progress Circle

    • override init(frame:)
    • bounds
      • open var bounds: CGRect
      • 자신만의 좌표시스템 안에서의 view의 위치와 크기
      • heightConstraint?.constant = progress * bounds.height
    • layoutIfNeeded self?.layoutIfNeeded()
    • layoutSubviews() override func layoutSubviews()
    • masksToBounds containerView.layer.masksToBounds = true
  3. Display the Header View

    • elementKindSectionHeader static var elementKind: String { UICollectionView.elementKindSectionHeader }
    • supplementaryViewProvider
  4. Update Progress Dynamically

    • willDisplaySupplementaryView
  5. Make the Progress View Accessible

    • setNeedsLayout()
NEULiee commented 2 years ago

Creating a Gradient Background

Learned

  1. Create a Gradient Layer
    • 그라데이션 배경 만들기
    • extension CAGradientLayer
      • collectionView 의 backgroundView 에 넣을 UIView() 를 새로 만든다.
      • 그라데이션 layer 를 만들어서 새로만든 UIView()addSubLayer() 로 추가한다.
      • collectionView의 backgroundView에 넣는다.
      • 블로그 글 작성