• 左右滑动页面


    #pragma mark- 滑动

    @property (nonatomic, strong)UISwipeGestureRecognizer *leftSwipeGestureRecognizer;

    @property (nonatomic, strong)UISwipeGestureRecognizer *rightSwipeGestureRecognizer;

    #pragma mark- 初始化滑动页面

    -(void)handleSwipesInit{

        self.leftSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc]

                                           initWithTarget:self action:@selector(handleSwipes:)];

        self.rightSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipes:)];

        

        self.leftSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;

        self.rightSwipeGestureRecognizer.direction = UISwipeGestureRecognizerDirectionRight;

        

        [self.view addGestureRecognizer:self.leftSwipeGestureRecognizer];

        [self.view addGestureRecognizer:self.rightSwipeGestureRecognizer];

    }

    #pragma mark- 滑动页面

    - (void)handleSwipes:(UISwipeGestureRecognizer *)sender

    {

        if (sender.direction == UISwipeGestureRecognizerDirectionLeft) {

            

        }

        

        if (sender.direction == UISwipeGestureRecognizerDirectionRight) {

            [self backingtomainview];

        }

    }

  • 相关阅读:
    HDU 2476 String painter (*区间DP+基础Dp)
    hdoj 1405 The Last Practice
    hdu 2715 Herd Sums
    hdu 3617 Happy 2009
    hdu 1062 Text Reverse
    hdu 2716 Message Decowding
    hdu 1597 find the nth digit
    hdoj 1229 还是A+B
    hdu 1877 又一版 A+B
    hdoj 2045 不容易系列之(3)—— LELE的RPG难题
  • 原文地址:https://www.cnblogs.com/niexiaobo/p/4573784.html
Copyright © 2020-2023  润新知