This bug happens very specific in one, maybe two use cases. I have a screen that has five buttons and those five buttons load a different sub view controller depending on what kind of link it is. There is one regular view controller that loads straight away, there is one map view and there are three buttons that lead to web views.
When I tap around between these five screens using the buttons everything works great. However when Google (or another page with input like Yelp) is loaded inside one of the webviews and I tap inside of the search box of Google and then switch to the map, the map stays stuck in view (covering other views while they load underneath) when I try to switch to other views.
- It doesn't happen when I do not tap inside the search box of Google
- It does not happen when I tap inside the search box, go to a different sub view controller and then go to maps
- It does not happen when I go inside the search box and dismiss it again before switching
I try to completely unload the MKMapView at the moment the user switches using a method that is called before it's switched:
(void)willBeRemoved {
switch (self.map.mapType) {
case MKMapTypeHybrid: {
self.map.mapType = MKMapTypeStandard;
break;
}
case MKMapTypeStandard: {
self.map.mapType = MKMapTypeHybrid;
break;
}
default: {
break;
}
}
self.map.showsUserLocation = NO;
self.map.delegate = nil;
[self.map removeFromSuperview];
self.map = nil;
}
I try dismissing the keyboard of any web view before switching to any other view:
- (void)willBeRemoved {
[self.webView endEditing:YES];
}
0 comments:
Post a Comment