본문 바로가기 메뉴 바로가기

개린이의 개발노트

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

개린이의 개발노트

검색하기 폼
  • 분류 전체보기 (73)
    • iOS (66)
      • iOS (10)
      • Swift (18)
      • SwiftUI (20)
      • RxSwift (5)
      • Project (2)
      • Study (3)
      • 코딩테스트 (6)
      • 삽질 (2)
    • Backend (7)
      • AWS (4)
      • Node.js (0)
      • Docker (2)
  • 방명록

carousel (1)
[SwiftUI] Carousel Card View

Why ? 스와이프하면 다음 카드로 이동하는 UI를 그리고 싶어서 Horizontal ScrollView를 사용했다가 스와이프하면 자동으로 중심을 맞춰주는 뷰를 구현하고 싶었다. How ? GeometryReader를 활용했다. GeometryReader { proxy in // 스크롤하면 움직일 x축의 값 let xOffsetToShift = cardWidth + spacing HStack(spacing: 10) { ForEach(Array(viewModel.places.enumerated()), id: \\.0) { idx, place in viewModel.createPlaceCard(place: place, index: idx) } } .padding(.leading, 22) // xOffsetT..

iOS/SwiftUI 2022. 8. 1. 06:21
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • CodingTest
  • Login
  • kakao
  • onTapGesture
  • AWS
  • SwiftUI
  • 의미있는이름
  • navigation
  • 곰튀김
  • rxswift
  • Swift
  • IOS
  • Generic
  • AWS Fargate
  • MVVM
  • enumerations
  • Custom
  • Git
  • file private
  • delegate
  • strcut
  • Protocol
  • Xcode
  • docker
  • 카메라
  • ObservedObject
  • ChatGPT
  • tabview
  • OCR
  • frame과 bounds 차이
more
«   2025/05   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바