I have a tableViewController that when a row is tapped on goes to a url using a KINWebBrowserViewController. The tableViewController should only be in portrait but the KINWebBrowserViewController can be landscape or portrait. When I go back to the tableViewController in landscape the tableViewController is also in landscape. How can I stop this?
The code for orientation:
class CustomNC: UINavigationController {
override func supportedInterfaceOrientations() -> Int {
if visibleViewController is KINWebBrowserViewController { return Int(UIInterfaceOrientationMask.All.rawValue) }
return Int(UIInterfaceOrientationMask.Portrait.rawValue)}
}
The code for didSelectRowAtIndexPath:
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let linkItem = linkLabels[indexPath.row] as String
let webBrowser = KINWebBrowserViewController()
let url = NSURL(string: linkItem)
webBrowser.actionButtonHidden = true
webBrowser.loadURL(url)
self.navigationController?.pushViewController(webBrowser, animated: true)
}
Any help?