Merge pull request #250 from TouchInstinct/fix/Add_presentedOrTopViewController
Add presentedOrTopViewController
This commit is contained in:
commit
e1ba5e5788
|
|
@ -1,5 +1,8 @@
|
|||
# Changelog
|
||||
|
||||
### 0.10.8
|
||||
- **Fix**: `Add presentedOrTopViewController`.
|
||||
|
||||
### 0.10.7
|
||||
- **Fix**: `Add BaseOrientationController`.
|
||||
- **Fix**: `Add videoOrientation extension`.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "LeadKit"
|
||||
s.version = "0.10.7"
|
||||
s.version = "0.10.8"
|
||||
s.summary = "iOS framework with a bunch of tools for rapid development"
|
||||
s.homepage = "https://github.com/TouchInstinct/LeadKit"
|
||||
s.license = "Apache License, Version 2.0"
|
||||
|
|
|
|||
|
|
@ -3,22 +3,24 @@ import UIKit
|
|||
open class OrientationNavigationController: UINavigationController {
|
||||
|
||||
// MARK: - Public properties
|
||||
|
||||
var presentedOrTopViewController: UIViewController? {
|
||||
presentedViewController ?? topViewController
|
||||
}
|
||||
|
||||
|
||||
open override var shouldAutorotate: Bool {
|
||||
presentedViewController?.shouldAutorotate
|
||||
?? topViewController?.shouldAutorotate
|
||||
presentedOrTopViewController?.shouldAutorotate
|
||||
?? super.shouldAutorotate
|
||||
}
|
||||
|
||||
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
presentedViewController?.supportedInterfaceOrientations
|
||||
?? topViewController?.supportedInterfaceOrientations
|
||||
presentedOrTopViewController?.supportedInterfaceOrientations
|
||||
?? super.supportedInterfaceOrientations
|
||||
}
|
||||
|
||||
open override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
||||
presentedViewController?.preferredInterfaceOrientationForPresentation
|
||||
?? topViewController?.preferredInterfaceOrientationForPresentation
|
||||
presentedOrTopViewController?.preferredInterfaceOrientationForPresentation
|
||||
?? super.preferredInterfaceOrientationForPresentation
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue