Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Until today I used the following solution:</p> <pre><code>-(void)setOrientation:(UIInterfaceOrientation)orientation { SEL rotation = @selector(_setRotatableViewOrientation:duration:); NSMethodSignature * methodSignature = [window methodSignatureForSelector:rotation]; if (methodSignature) { NSInvocation * ivc = [NSInvocation invocationWithMethodSignature:methodSignature]; [ivc setTarget:window]; [ivc setSelector:rotation]; // arg0 will be self, 1 will be cmd_ (current method selector) [ivc setArgument:&amp;orientation atIndex:2]; double duration = 0.4; [ivc setArgument:&amp;duration atIndex:3]; [ivc invoke]; } } -(void)normalizeOrientation { UIDeviceOrientation dOrientation = [UIDevice currentDevice].orientation; int orientation = -1; switch(dOrientation) { case UIDeviceOrientationPortrait: orientation = UIInterfaceOrientationPortrait; break; case UIDeviceOrientationPortraitUpsideDown: orientation = UIInterfaceOrientationPortraitUpsideDown; break; case UIDeviceOrientationLandscapeRight: orientation = UIInterfaceOrientationLandscapeLeft; break; case UIDeviceOrientationLandscapeLeft: orientation = UIInterfaceOrientationLandscapeRight; break; } if (orientation != -1 &amp;&amp; orientation != tabBarController.interfaceOrientation) [self setOrientation:orientation]; } </code></pre> <p>but the official AppStore wont accept new releases of my App due to _setRotatableViewOrientation:duration:transition:toView: isn't documented API.</p> <p>So be aware for use it in your commercial projects! Apple new automated API checker will reject your App!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload