-5

1) I am not using any storyboards, and in the appDelegate file I'm setting the window's rootViewController as a tabBarController.

2) This tabBarController has 5 childs, those childs are navigationControllers with ViewControllers as roots.

2) Each of this childs are TableViewControllers, and when clicking a tableViewCell, I need to push to another ViewController

The problem is: https://postimg.cc/image/ocskkyye5/

I tried pushing the viewController by clicking one of the cells, but the screen freezes and when I swipe form left to right, the controller is being shown from right

Solve it. It was because I was using the navigationbar’s hide with animation method istead of the navigationbar’s isHidden method.

1 Answers1

0

when I swipe form left to right, the controller is being shown from right

Disclaimer: I usually am in Cocoa so not all here may work.

The tableView is in focus, so is also first responder and so the UIScrollView in which the TableView is embedded eats your swipes and scrolls instead. One option if you don‘t need vertical scrolling either is to remove the scrolling part by modifying the view hierarchy or by using a custom scrollView class which pipes all the scrollWheel events to nextResponder. You could also implement a custom UIScrollView and set the custom class as the one used in your scrollView. The class would maybe split every scroll event up into vertical and horizontal event, whereby the vertical go to super.scrollWheel(with:)and the horizontals go to nextResponder.scrollWheel(with:). Another shot in the dark would be to set the view inside the scrollView fixed to the scrollViews‘ leading and trailing anchor so it cannot change size, dunno whether that still eats vertical scroll wheels though, so probably won‘t work.

I tried pushing the viewController by clicking one of the cells, but the screen freezes

Freezes can have lots of reasons. Maybe deadlock, maybe sth else. Do you receive the action event? If so please try to find where it freezes with breakpoints and show some code. or are you using segues? Not enough info.

Fabian
  • 5,040
  • 2
  • 23
  • 35
  • Well, for the rootView controller there should be no swipe from left to right, because it's a rootVC. The thing is that: Everything work perfectly normal if I don't swipe form left to right in the rootVC, everything is pushed as they should be and the navigation swipes work fine. As soon as I get to the rootViewController and I swipe then try to push a VC again, the bug occurs. There are no errors in console! – Mihail Stoica Jul 08 '18 at 06:31
  • I've edited the video link, take a look if you didn't already. Thanks for your answer. One thing that I just observed: As soon as you swipe from left to right in the VC, then click on a cell that suppose to push another VC, a `SHADOW` appears on the right side – Mihail Stoica Jul 08 '18 at 06:32
  • Maybe sb else knows the answer, since it seems don't know it. – Fabian Jul 08 '18 at 07:15
  • Solve it, thanks again. It was because I was using the navigationbar’s hide with animation method istead of the navigationbar’s isHidden method. – Mihail Stoica Jul 08 '18 at 07:21
  • Hmm interesting, very good! – Fabian Jul 08 '18 at 07:22