How to create a dialog like Twitter in programming?

Discussion in 'iOS Programming' started by mikezang, Mar 9, 2012.

  1. mikezang macrumors 6502a

    May 22, 2010
    Tokyo, Japan
    I want to create a universal dialog both for iPhone/iPad in programming easily?
    Does anyone give me a suggestion?

    Attached Files:

  2. vultureboy macrumors member


    Nov 28, 2006
    Blackpool, UK
    You'd have to make sure your app is Universal (of course) and this is how I load my credits modal dialog...

        BOOL deviceIsPad = (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone);
        AppCredits *appCredits = nil;
        if (deviceIsPad) {
            appCredits = [[AppCredits alloc] initWithNibName:@"AppCredits_iPad" bundle:nil];
            [appCredits setModalPresentationStyle:UIModalPresentationFormSheet];
        } else {
            appCredits = [[AppCredits alloc] initWithNibName:@"AppCredits_iPhone" bundle:nil];
        [self presentModalViewController:appCredits animated:YES];
    This shows the modal view full screen on the iPhone and in a smaller Presentation Form Sheet on the iPad.

    Hope that helps!
  3. mikezang thread starter macrumors 6502a

    May 22, 2010
    Tokyo, Japan
    Thanks for your suggestion, so I have to create two xib files in Storyboard, is it true? is there any template so that it looks like what in pictures?

Share This Page