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 4624368
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:07:11+00:00 2026-05-22T03:07:11+00:00

The [[UIDevice currentDevice] orientation] method returns a number of orientations beyond the portrait and

  • 0

The [[UIDevice currentDevice] orientation] method returns a number of orientations beyond the portrait and landscape orientation. I am well aware of checking to see if the orientation returned is “valid”, unfortunately if the orientation returned is NOT “valid” when my app requires a specific orientation to determine which methods to run, I have no way of knowing which method is appropriate.

I have attempted a number of solutions to this, but for now the only thing I have been able to work out is to check to see if the orientation is LandscapeLeft or LandscapeRight and if it isn’t I assume the screen is in portrait orientation. Unfortunately this isn’t true when the device is face up and the screen is in landscape orientation.

I attempted to use the parent view controller’s orientation:

parentController.interfaceOrientation;

Unfortunately it returned UIDeviceOrientationUnknown. I search SO and Google for someone else who has faced this problem. It seems silly to me that Apple would have anything but LandscapeLeft/Right and PortraitUp/Down for their orientations.

What I really need is the APPS orientation not the devices, since these are sometimes at odds. Any advice?

  • 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-05-22T03:07:12+00:00Added an answer on May 22, 2026 at 3:07 am

    Have you tried using UIInterfaceOrientationPortrait/UIInterfaceOrientationLandscape? I usually have pretty good results using these methods:

    if(UIInterfaceOrientationIsPortrait(viewController.interfaceOrientation)) {
        //do portrait work
    } else if(UIInterfaceOrientationIsLandscape(viewController.interfaceOrientation)){
        //do landscape work
    }
    

    You might also try UIDeviceOrientationIsValidInterfaceOrientation.

    These will only return the app’s orientation, which may not be the same as the device’s orientation.

    If those don’t work, you can also try:

    [[UIApplication sharedApplication] statusBarOrientation]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem that [UIDevice currentDevice].orientation returns 0 in some cases. In my
([UIDevice currentDevice].orientation); using the above code in my app, all i get is 0
I have this method but where should i put this method??? [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
Hey this is the code I am using switch ([[UIDevice currentDevice] orientation]) { case
I want to query the orientation the iPhone is currently in. Using [UIDevice currentDevice].orientation
a noob question here. i detect the orientation with: UIInterfaceOrientation orientation = [[UIDevice currentDevice]
I am using the following code to set the device orientation [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
Please, help me. I have methods: -(void) getCurrentOrientation{ UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
What will [[UIDevice currentDevice] model] return for iPad?
I'm trying to find out if the device is in portrait or landscape mode.

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.