ios - Add a Network Coverage UIView to MKMapView -


i have mkmapview - working well. have notifications viewcontroller responds when network coverage goes down. when happens, want show simple uiview uilabel tells user network down.

i having lots of lots of problems trying achieve this. have built view in in interface builder , initialising in viewdidload:

 self.networkwarningview = [[[nsbundle mainbundle] loadnibnamed:@"networkwarningview"                                                              owner:nil                                                            options:nil] lastobject];   self.networkwarningview.frame = cgrectmake((self.view.bounds.size.width / 2) - 140, (self.view.bounds.size.height / 2) - 45, 280, 70); 

then handling network down notification using method:

-(void)handlenetworkwarning     {          self.hasnetworkfailure = yes;          bool shouldbeadded = yes;         for(uiview *view in [self.view subviews]){             if([view isequal:self.networkwarningview]){                 shouldbeadded = no;             }         }          if(shouldbeadded){              self.networkwarningview.alpha = 0.0;              [self.view addsubview:self.networkwarningview];              [uiview animatewithduration:0.7 animations:^{                self.networkwarningview.alpha = 1.0;             }];         }      } 

i have tried adding warningview view controller view , map view - neither of these approaches work. 'animate in' warning when occurs.

any advise how best overlay view on mkmapview appreciated. thought simple....

thanks

this stupid.

anyone working mapkit - remember notifications should result in ui change should dispatched main thread. dispatching them background worker thread no wonder nothing happening!


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -