Overlay image for App tutorial swipe left & right & close tutorial when click bottom right done text

UIImage

NSMutableArray *arrOverlayImg;

    int intOverlayImg;

arrOverlayImg = [[NSMutableArray alloc]initWithObjects:@”walkthrough-bg-01″,@”walkthrough-bg-02″,@”walkthrough-bg-03″,@”walkthrough-bg-04″, nil];

    

    [self.view bringSubviewToFront:_HomeScreenTransaparentImgvw];

    

    UITapGestureRecognizer *taprecognzr = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(taprecognzractn:)];

    taprecognzr.delegate = self;

    [_HomeScreenTransaparentImgvw addGestureRecognizer:taprecognzr];

    

    

    

    UISwipeGestureRecognizer * swprecognzrright = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swpgstrrightactn:)];

    [swprecognzrright setDirection:(UISwipeGestureRecognizerDirectionRight)];

    [_HomeScreenTransaparentImgvw addGestureRecognizer:swprecognzrright];

   

    

    UISwipeGestureRecognizer * swprecognzrleeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swpgstrleftactn:)];

    [swprecognzrleeft setDirection:(UISwipeGestureRecognizerDirectionLeft)];

    [_HomeScreenTransaparentImgvw addGestureRecognizer:swprecognzrleeft];

    

-(IBAction)taprecognzractn:(UITapGestureRecognizer *)tapGstr

{

    CGFloat width = [UIScreen mainScreen].bounds.size.width;

    CGFloat height = [UIScreen mainScreen].bounds.size.height;

    NSLog(@”%f :: %f”,width,height);

    

    

    

     CGPoint tapLocation = [tapGstr locationInView:_HomeScreenTransaparentImgvw];

    

    

    NSLog(@”%f”,width-tapLocation.x);

    NSLog(@”%f”,height-tapLocation.y);

    

    if (tapLocation.x > (width – 50) && tapLocation.y > (height – 30))

    {

    //     _HomeScreenTransaparentImgvw.hidden = YES;

        NSLog(@”Hide Transper Image”);

    }

    

    

}

-(IBAction)swpgstrrightactn:(id)sender

{

    if (intOverlayImg >=1)

    {

        intOverlayImg –;

        

        _HomeScreenTransaparentImgvw.image = [UIImage imageNamed:[arrOverlayImg objectAtIndex:intOverlayImg]];

        

    }

    

}

-(IBAction)swpgstrleftactn:(id)sender

{

    if (intOverlayImg <=2)

    {

        intOverlayImg ++;

        _HomeScreenTransaparentImgvw.image = [UIImage imageNamed:[arrOverlayImg objectAtIndex:intOverlayImg]];

        

    }

}

Leave a comment