0

I've got a UITableview that displays the search results of a UISearchController. They are inside of a Childviewcontroller. I write the text on the textfield of the parentviewcontroller and it passes the text to the searchbar of the child view controller.

This all works fine.

But for some reason, when I am choosing a result in the child view controller's tableview, it is not very responsive.

After typing in the search text in the textfield (having the textfield as the firstResponder), most of the times I have to tap more than once to select a row.

(P.S. userInteraction is enabled, otherwise no touch would ever go through.)

Any idea why?

jonypz
  • 1,515
  • 1
  • 20
  • 35

2 Answers2

0

I have same problem, and my solution is:

- (void) displayContentController: (UIViewController*) content{
[content.view setFrame:recorderView.bounds];
UINavigationController *childNavController = [[UINavigationController alloc] initWithRootViewController:content];
childNavController.toolbarHidden = NO; // if you show toolbar
childNavController.view.frame = content.view.frame;
[self addChildViewController:childNavController];
[recorderView addSubview:childNavController.view];
[childNavController didMoveToParentViewController:self];
}

content is my subViewController

anhhtbk
  • 89
  • 2
  • 12
-1

Is this for Swift or for Objective-C? Also are you placing a UI Tap Gesture Recognizer on the views that you wish to be touchable?

Rudi
  • 95
  • 9
  • Objective-C. I did not add any tap gesture here as the user interaction is enabled on the child vc's view and the tableview inside of it already recognizes touches by default – jonypz Apr 09 '16 at 05:12
  • I'm not sure why it would work on some taps but not all. I would use the UI Tap Gesture Recognizer just to be sure that it's not just an issue with the ViewControllers. – Rudi Apr 10 '16 at 19:53