Scrollable View Controllers

Seoyoung Lee·2022년 3월 2일
0

Professional iOS

목록 보기
8/12
post-thumbnail

The UIScrollView

스크롤 가능한 모든 뷰 컨트롤러들은 UIScrollView를 상속받는다.

장점

  • Makes anything scsrollable
  • Minimalist
  • Full conrol
  • Good for long pages

단점

  • Can’t easily reload
  • No built in affordances (i.e. pull to refresh)
  • Auto Layout more complex

The UICollectionView

장점

  • Customizable layouts
    • flow layout
  • Multi-column scrollable
  • Can dynamically change layout
    • 런타임에서 레이아웃을 변경할 수도 있다.
  • Good for photos in a grid

단점

  • More complex
  • Often overkill
    • 단순한 레이아웃을 만들 때는 비효율적이나, 복잡한 레이아웃을 구현할 때는 적합하다.

The UITableView

UITableView의 구성

  • Header
  • Section
    • Section Header
    • Section Footer
  • Rows or data
  • Footer

장점

  • Highly performant (reuseIdentifiers)
  • Many affordances built in (header, footer, sections)
  • Perfect for single column list

단점

  • Hard to do complex non-single column layouts

Which to choose and when

Which to use?

  • UIScrollView: Common
  • UICollectionView: Rare (실제 프로젝트에서 많이 쓰이지 않음)
  • UITableView: All the time
profile
나의 내일은 파래 🐳

0개의 댓글

관련 채용 정보