I have iOS app with only portrait mode enabled and one of it's ViewControllers has chart. Chart is created using PNChart library.
How can I rotate this chart so it will be in landscape orientation in Swift (iOS 7, 8, 9)?
I use this code in AppDelegate but with no luck - view is rotated but chart is not and i can see only half of it now
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
if self.window?.rootViewController is myChartViewController {
return UIInterfaceOrientationMask.Landscape
}
// Else only allow the window to support portrait orientation
else {
return UIInterfaceOrientationMask.Portrait
}
}