Segmented Controls

iOS Segmented Control의 슬라이딩 선택 애니메이션과 세그먼트 수를 바꿔보세요.

9:41
●●●●WiFi🔋
Library
All
Music
Podcasts
Showing all items
View Mode
Grid
List
Grid view selected
Time Range
Day
Week
Month
Year
Showing daily data
⚠️ HIG 위반: 세그먼트 컨트롤이 부적절합니다
📚 HIG Guidelines — 직접 체험하기
✓ Do — 올바른 예시
✗ Don't — 나쁜 예시

✓ 이렇게 하세요

  • Use 2-5 segments maximum
  • Keep segment labels short and equal width
  • Use to switch between views of the same content
  • Always have one segment selected

✗ 이렇게 하지 마세요

  • Don't use more than 5 segments
  • Don't mix text and icons in segments
  • Don't use for navigation between different screens
  • Don't use when options are not closely related

👆 iPhone 미리보기에서 나쁜 패턴을 직접 확인해보세요

Text Only
With Icons
SwiftUI Code
@State private var selection = 0 Picker("Category", selection: $selection) { Text("All").tag(0) Text("Music").tag(1) Text("Podcasts").tag(2) } .pickerStyle(.segmented)