Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A UIViewController subclass which implements its own auto-rotation logic, so its view can be placed directly into a UIWindow above other views.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 AQSelfRotatingViewController.h
Octocat-spinner-32 AQSelfRotatingViewController.m
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.textile
README.textile

A Self-Rotating View Controller

If you have a need to place a view controller directly into a window, without it being a child of that window’s root view controller, then you’ll likely have found that rotation doesn’t happen automatically for you. Which is a serious pain. This class has the answer.

Using AQSelfRotatingViewController

Make your controller class a subclass of AQSelfRotatingViewController. Before adding its -view to your UIWindow, be sure to call -viewWillAppear:, and also call -viewDidAppear: after adding it. Likewise call -viewWillDisappear: and -viewDidDisappear: when removing the view from the window.

That’s it. No, really— that’s it.

Something went wrong with that request. Please try again.