How to create a dialog like Twitter in programming?

Discussion in 'iPhone/iPad Programming' started by mikezang, Mar 9, 2012.

  1. macrumors 6502a

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

    Attached Files:

  2. macrumors member

    vultureboy

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

    Code:
        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. thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #3
    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