Here is my scenario:
I have a UIViewController in my StoryBoard for my display function. I am adding a Google Map view (GoogleMaps iOS 1.3.1), for example:
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86 longitude:151.20 zoom:6]; mapView_ = [GMSMapView mapWithFrame:CGRectMake(0, 49, 320, 450) camera:camera]; mapView_.myLocationEnabled = YES; self.view = mapView_;
Created a custom view: MapTopBar.xib. Simply put, this is a UIView with a UIImageView (background) and a UITextField and Button. It has a support class file and all UITextFields properties are set (delegate, outputs, etc.).
I am adding my custom view to my VC map, for example:
UIView *topBar = [[MapTopBar alloc] initWithFrame:CGRectMake(0, 0, 320, 49)]; [self.view addSubview:topBar];
My custom view is added to the main view, but the UITextField does not receive any touch events. The keyboard is not displayed, there is no cursor in the field, nothing. It is as if something is covering him, not allowing him to interact with the user. The button next to it can be pressed and works fine.
I tried to do this in different ways (creating a full topBar view programmatically, adding a text box programmatically), and regardless of whether the text box will not interact with the user.
I turned on user interaction, make sure there was no view above the text box, all for zero. I feel that I am missing something simple. Why can't I interact with my text box?
Also: in case it matters, the code above is inside it, and its sub-call is called from viewDidLoad before the super-call.