0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

XLPagerTabStripが使われている画面でスワイプバックを使いたい

Posted at

問題

NavigationControllerで遷移した先の画面がXLPagerStripを使用していた場合、配置されてるcontainerView(UIScrollView)に引っ張られて
スワイプバック(Interactive Pop Gesture)が効かなくなってしまう。

解決策

以下のコードをviewWillAppearに追加する。

containerViewのGestureはNavigationControllerのGestureが失敗した時に実行されるようにする?という感じ。

if let naviVc = self.navigationController {
    self.containerView.panGestureRecognizer.require(toFail: naviVc.interactivePopGestureRecognizer!)
}

参考サイト

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?