title: iOS Universal Development – Use of Tilde Sign (~) in Xib File and Image Name for differentiation
body: <p>While developing <code>universal apps</code>, we have to write a <code>conditional code</code> for each <code>device</code> – the <code>iPad</code> as well as the <code>iPhone</code>. In this scenario, the proper use of <code>tilde</code> can be extremely beneficial.</p>
  
  <p>For example, if you want to push new view controller, then you’d have to write lot of lines (almost 10) of code:</p>
  
  <pre><code>if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
  {
    MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@”MasterViewController_iphone” bundle:nil];
   [self.navigationController pushViewController:masterViewController animated:YES];
   [masterViewController release];
  }
  else
  {
    MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@”MasterViewController_ipad” bundle:nil];
    [self.navigationController pushViewController:masterViewController animated:YES];
    [masterViewController release];
  }
  </code></pre>
  
  <p><strong>How can we differentiate images for iphone and ipad?</strong></p>