검색결과 리스트
글
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
웹뷰에서 Swipe 재스쳐를 통해 웹의 back / forward를 구현해야 할 일이 있어서 아래의 소스를 찾았다.
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
// Setting the swipe direction.
[swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
[swipeRight setDirection:UISwipeGestureRecognizerDirectionRight];
// Adding the swipe gesture on WebView
[webView addGestureRecognizer:swipeLeft];
[webView addGestureRecognizer:swipeRight];
- (void)handleSwipe:(UISwipeGestureRecognizer *)swipe {
if (swipe.direction == UISwipeGestureRecognizerDirectionLeft) {
// 왼쪽으로 Swipe되었을 때 처리
}
if (swipe.direction == UISwipeGestureRecognizerDirectionRight) {
// 오른쪽으로 Swipe되었을 때 처리
}
}
'-- iOS (iPhone)' 카테고리의 다른 글
WKWebView to handle Social Logins like Facebook, LinkedIn and Google (0) | 2020.02.09 |
---|---|
XCODE 단축키 정리 (0) | 2019.06.18 |
Top 5 iOS libraries every iOS developer should know about (0) | 2017.01.18 |
iOS8 이상에서 LocationManager 작동 안함 (0) | 2016.05.23 |
Applications are expected to have a root view controller at the end of application launch (0) | 2016.04.26 |
RECENT COMMENT