Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:15:05+00:00 2026-06-13T12:15:05+00:00

In my project I have 3 xib files to support different devices. I need

  • 0

In my project I have 3 xib files to support different devices. I need to support all devices: iPhone 3, iPhone 4, iPhone 5.

There are:

  • ViewController_iPhone_480.xib
  • ViewController_iPhone_568.xib
  • ViewController_iPad.xib

So, the main problem is that I need to detect which iPhone is being used and load the xib for it.

Very important: I need to check not just the iOS version. And also I don’t need to check height or width of screen because it is very strange (for example, if some other device from Apple will have the same height or width in future – how does it help me?)

Have you got a method how to detect an iPhone 5 in code?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:15:06+00:00Added an answer on June 13, 2026 at 12:15 pm
    CGSize result = [[UIScreen mainScreen] bounds].size;
    result.height; // height in pixels
    result.width; // width in pixels
    

    Just check the result and make your decision upon that.
    iPhone 4 has 480 in height, and iPhone 5 has 568 in height.

    EDIT: you can check the current device your running on, before you look at height and width.

    NSString *deviceType = [UIDevice currentDevice].model;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a several XIB files in my iOS project for various custom table
So in my XCode project I have a handful of XIB files that for
I have an XCode project, with the XIB interface files built using Interface Builder.
I have created a new iPhone project in Xcode 4 and added some files
I have the same problem with some xib files in different projects on different
i have created a project which has different xib viewcontrollers.In first view am selecting
I have project asp.net with namespace test and I'm using resources (files Resource.resx and
I have found two ways to enable localization for iOS project: Creating localized .xib
Very new to Iphone development here, I have a project which is successfully building
I am updating an iPhone app to an universal. I have different views controller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.