Just My Life & My Work

好久以前就知道有些App螢幕左邊界右滑回上一頁的功能,因為專案回上一頁都有按鈕,也沒特別要求用該手勢,所以一直以為預設就可以用,在我閒情逸致時查詢,總算知道怎麼設定啦~

ios back gesture2

只要兩個步驟就搞定!

/**
 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

ios back gesture

輕輕鬆鬆就能回上一頁,很棒不是嗎?

廣告

隨意留個言吧:)~

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com 標誌

您的留言將使用 WordPress.com 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 /  變更 )

連結到 %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

標籤雲

%d 位部落客按了讚: