Interface orientation issue after presenting video attachment from TWTRTweetView

ios
twitterkit

#1

Hi,

I have an application which supports following device orientations – Portrait, Landscape Left, Landscape Right.

In this application I have WhiteViewController which is embedded in NavigationController. NavigationController supports only Portrait orientation. As a result WhiteViewController supports only Portrait orientation as well.

@interface NavigationController ()

@end

@implementation NavigationController

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

@end

From WhiteViewController I can present modally BlueViewController which supports all kinds of interface orientations.


@interface BlueViewController ()

@end

@implementation BlueViewController

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationLandscapeRight;
}

@end

After BlueViewController has been presented I rotate the device to landscape and dismiss it. WhiteViewController stays in Portrait orientation.

In WhiteViewController I also have TWTRTweetView with tweet which has video attachment.

I discovered that when I press play button video opens in TWTRVideoViewController which also supports all kinds of interface orientations, so If I close this controller in landscape orientation, WhiteViewController will be in landscape orientation too (which is inappropriate).

Could you fix that?

Test project with described issue is available on GitHub: https://github.com/kmordan/tweet-interface-orientation-test

Don’t forget replace Fabric Run Script in Build Phases with your script version and provide APIKey, consumerKey, consumerSecret into Info.plist.

TwitterKit (2.8.1)