title: Reduce alert view coding
body: <p>All.
  In my iOS app.
  On many pages I am having <strong><em><code>Too many alerts and also with many Network conditions.</code></em></strong></p>
  
  <p>With too many alert texts I am fed up.
  And Every time I have to put the same code.</p>
  
  <p>Can I declare this Code in Some Helper Class ?
  Or Reuse this Code ?</p>
  
  <pre><code>-(BOOL)checkInternetAndlocationServices {
  
      if(IS_INTERNET) {
          if([CLLocationManager locationServicesEnabled] &amp;&amp;
             [CLLocationManager authorizationStatus] != kCLAuthorizationStatusDenied){
              return YES;
          }
          else
          {
              NSLog(@"Location services are disabled.");
              UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Location services are off." message:@"This app requires an Location services." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Location Services", nil];
              [alert setTag:NO_LOCATIONSERVICES];
              [alert show];
              return NO;
          }
      }
      else
      {
          UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Internet connection is off." message:@"This app requires an internet connection and locations services, please enable internet connection and location services." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Settings", nil];
          [alert setTag:NO_INTERNET];
          [alert show];
          return NO;
      }
  }
  </code></pre>
  
  <p>Thanks. 
  Please edit this question, if you found it useful..</p>
  
  <p>Thanks for giving good approaches, still any other ways, examples are most welcome.</p>