일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ar
- iphone
- authentication
- stateobject
- arkit
- CS
- Animation
- realitykit
- WWDC
- firebase
- 네트워크
- 달력
- gesture
- 데이터최적화
- RxSwift
- state
- SwiftUI
- withAnimation
- swift
- GCD
- Network
- Performance
- UIKit
- auth
- dataflow
- Concurrency
- ios
- combine
- environmentobjet
- fullscreencover
- Today
- Total
목록gesture (2)
XLOG
오랜만에 포스팅이다. 두 가지 버전으로 InfinityCarousel 을 구현해볼 예정이다. 그 전에 알아야 할 것은 두가지 버전에 기본 원리는 똑같다. 만약 4가지의 ImageView를 돌리려고 가정을 해보자. let colors: [Color] = [.red, .green, .blue, .yellow] @State var currentIndex: Int = 0 GeometryReader { reader in let width = reader.size.width TabView(selection: $currentIndex) { ForEach(colors, id: \.self) { color in Rectangle() .fill(color) .frame(width: width) } } } 이런식으로 보통 ..
SwiftUI의 경우 view에 onTapGesture를 추가하게 되면 간단하게 탭제스쳐에 반응을 할 수 있게 된다. 하지만 UIKit에서는 onTapGesture가 없다. 하지만 개발을 하다보면 버튼이 아닌 imageView 나 기타 UIView에 액션을 추가하고 싶은 일이 발생한다. 우리에게 필요한것은 gesture 객체와, view가 필요하다. 또한 viewController에 view에 isUserInteractionEnabled 의 변수 값을 true로 설정해주면 된다. private let actionView = UIView() let gesture:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(t..