0

I'm adding universal support to an iPad-only app. The first screen has a view containing a button for accessing app settings. Currently, in the iPad-only version, the settings appear in a UIPopoverView, and the UIPopoverController is a property of the app's view controller. In the iPhone version, it should use a modal popup instead, but the question is how to go about breaking up the view controller and view as it stands now.

@interface ClientSelectionController : UIViewController <UISearchBarDelegate, UIAlertViewDelegate>
{
@private
    UIPopoverController *settingsPopover;
}

-(IBAction)btnSettingsTouchedDown:(id)sender;
@end

Should I make two different view classes for the controller, and make the UIPopoverController a child of the ClientSelectionView_iPad version, or should I instead make two different versions of the ClientSelectionController, one with the UIPopover, and the other with the modal popup?

GoldenJoe
  • 7,874
  • 7
  • 53
  • 92

1 Answers1

0

you would first find out what kind of device your are on

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
//iphone
    } else {
//ipad
    }

Then just make the calls to the popover/modal respectively

normally though you would have 2 xib files to a single view controller. One xib for iphone and one for ipad because of the different resolutions

owen gerig
  • 6,165
  • 6
  • 52
  • 91