سؤال

To force change device orientation, I take code from here

but can apple reject app that use setOrientation: ? have some one experience?

or may be someone have 100% work and not can be rejected by Apple, solution?

if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) {
        if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
            int orientationPortrait = UIInterfaceOrientationPortrait;
            NSMethodSignature *sig = [[UIDevice currentDevice] methodSignatureForSelector:@selector(setOrientation:)];
            NSInvocation* invo = [NSInvocation invocationWithMethodSignature:sig];
            [invo setTarget:[UIDevice currentDevice]];
            [invo setSelector:@selector(setOrientation:)];
            [invo setArgument:&orientationPortrait atIndex:2];
            [invo invoke];
        }
    }

Ok, thanks, I will try with this snippet.

هل كانت مفيدة؟

المحلول

NO, Apple will reject on the basis of force orientation. Some times it is requirement and only way to view in landscape/portrait. Apple will not REJECT .

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top