Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Git
- Archive
- Xcode
- 이미지
- iOS16
- github
- 웹뷰
- Realm
- mac
- Firebase
- window
- 개발자
- 한글
- view
- UIButton
- appstore
- Apple
- IOS
- Swift
- FLUTTER
- rxswift
- error
- MacOS
- Notification
- geofencing
- JPA
- Code
- SwiftUI
- darkmode
- Session
Archives
- Today
- Total
EEYatHo 앱 깎는 이야기
Swift) CollectioView 페이징 스와이프UX 핵심 - EEYatHo iOS 본문
반응형
콜렉션뷰를 유저가 스와이프할 때, 어떤 위치의 아이템을 보여줄지 알아내는 소스
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
// 스와이프시 애니메이션 끝날 떄 위치를 미리 알 수 있음
let index = Int(targetContentOffset.pointee.x / view.frame.width)
...
}