好久以前就知道有些App螢幕左邊界右滑回上一頁的功能,因為專案回上一頁都有按鈕,也沒特別要求用該手勢,所以一直以為預設就可以用,在我閒情逸致時查詢,總算知道怎麼設定啦~
只要兩個步驟就搞定!
/** Theme: Back Gesture IDE: Xcode 7 Language: Objective C Date: 105/07/20 Author: HappyMan Blog: https://cg2010studio.wordpress.com/ */ // HLBasicViewController.h #import <UIKit/UIKit.h> @interface HLBasicViewController : UIViewController <UINavigationControllerDelegate, UIGestureRecognizerDelegate> @end // HLBasicViewController.m #import "HLBasicViewController.h" @interface HLBasicViewController () @end @implementation HLBasicViewController - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.interactivePopGestureRecognizer.delegate = self; } @end
輕輕鬆鬆就能回上一頁,很棒不是嗎?
隨意留個言吧:)~