Wipe effect tablet controller

I am trying to make a Tabbar Controller as shown below:

image

Scrolling through the viewcontroller, it redirects to the next tab. How can we achieve this in iOS? Are there any other controls to do this?

+4
source share
3 answers

Just add a UISwipeGestureRecognizer to your tabBarView controller and change your tabBar index after scrolling.

swipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeMethod:)]; swipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft; [self addGestureRecognizer:swipeRecognizer]; 

And my napkin processing method:

 -(void)swipeMethod: (UISwipeGestureRecognizer *) sender { NSLog(@"Swipe!"); } 

EDIT
Or you can use UIScrollView with paging and UIView to display your data.

Here is the tutorial you are looking for a tab controller with swipte effect

+2
source

GitHub has a library for this, called MGSwipeTabBarController, and is designed to do exactly what you are looking for.

It is as simple as:

 NSArray *viewControllers = . . . //your view controllers MGSwipeTabBarController *swipeController = [[MGSwipeTabBarController alloc] initWithViewControllers:viewControllers]; 

Note that it is only compatible with iOS7 and +, and you still need to create your own tab bar that responds to scroll events using the MGSwipeTabBarControllerDelegate protocol.

https://github.com/mglagola/MGSwipeTabBarController

+1
source

https://github.com/nicklockwood/SwipeView you can use this class to achieve your goal ...

otherwise you have to make an animation to click on the tab using the following method,

 [UIView transitionFromView:<#(UIView *)#> toView:<#(UIView *)#> duration:<#(NSTimeInterval)#> options:<#(UIViewAnimationOptions)#> completion:<#^(BOOL finished)completion#>] 
0
source

Source: https://habr.com/ru/post/1487996/


All Articles