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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:44:48+00:00 2026-06-14T00:44:48+00:00

my app doesn’t support rotation. But I want to present a QLPreviewController that supports

  • 0

my app doesn’t support rotation. But I want to present a QLPreviewController that supports rotation.
I present the QLPreviewController like this:

[self presentModalViewController:thePrevController animated:NO];

How can I do this?

  • 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-14T00:44:49+00:00Added an answer on June 14, 2026 at 12:44 am

    Enable all rotations in your application plist file. This will make all views rotate irrespective of the settings in the view controller.

    Then subclass your root UINavigationController as below, adding the rotation control code for iOS5 and 6 depending on your requirements:

    I was updating an old app with MainWindow.xib, so I changed the class of the navigation controller in the xib file to CustomNavigationController. But in a more modern app with say a main menu, you’d instantiate the nav controller like this:

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    
    MainMenuVC *masterViewController = [[MainMenuVC alloc] initWithNibName:@"MainMenuVC" bundle:nil];
    self.navigationController = [[CustomNavigationController alloc] initWithRootViewController:masterViewController];
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    

    Subclass UINavigationController

    #import <UIKit/UIKit.h>
    
    @interface CustomNavigationController : UINavigationController
    
    @end
    
    #import "CustomNavigationController.h"
    
    @interface CustomNavigationController ()
    
    @end
    
    @implementation CustomNavigationController
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    
    -(BOOL)shouldAutorotate
    {
        return NO;
    }
    
    -(NSUInteger)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskPortrait;
    }
    
    @end
    

    Then subclass the QLPreview controller so you can override the rotation code which will enable rotation for the QLPreviewController only. The rest of the app with views pushed from your CustomNavContoller will not rotate as the CustomNavigationController is locked.

    I added this interface and implementation at the top of the view controller where I wanted to present the QLPreviewController.

    @interface RotatingQLPreviewController : QLPreviewController
    
    @end
    
    @implementation RotatingQLPreviewController
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    }
    
    -(NSUInteger)supportedInterfaceOrientations
    {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    }
    
    -(BOOL)shouldAutorotate
    {
        return YES;
    }
    
    @end
    

    Then present your QLPreviewController using your subclass.

    RotatingQLPreviewController *preview = [[RotatingQLPreviewController alloc] init];
            preview.dataSource = self;
            [self presentViewController:preview
                               animated:YES
                             completion:^(){
                                 // do more stuff here
                             }];
    

    This method should work for other modal views that you want to rotate, but I haven’t tried it.

    I implemented this method in the latest app I’m working on and works in both iOS5 and 6.

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Google App Engine doesn't support SSL for custom domains. Does this mean that it's
My app doesn't run on the slower hardware, but I want to support iOS
My iPhone app can't seem to use soft keyboards that doesn't use the US-like
My problem is: my app doesn't install sd card. But I write this code
Apache 2.2.17 PHP 5.3.3 Currently, my app doesn't use gzip, but I would like
I have setup airbrake in my app but it doesn't seem to log any
So I have an app that if I'm honest doesn't really need transactional integrity
I have a facebook app using a lot of Javascript that doesn't work correctly
I have just discovered that my app doesn't run in 4.3 even though the
I am trying to cover my bases with reachability so that my app doesn't

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.