From 4c81de418f29bdc7ddc0382d8d0dc7c5f20c85c4 Mon Sep 17 00:00:00 2001 From: Boyko Mihail Date: Mon, 5 Oct 2020 10:31:48 +0300 Subject: [PATCH 1/2] Add presentedOrTopViewController --- .../BaseOrientationNavigationController.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/Classes/Controllers/BaseOrientationNavigationController.swift b/Sources/Classes/Controllers/BaseOrientationNavigationController.swift index 9c431a9f..9b9280a0 100644 --- a/Sources/Classes/Controllers/BaseOrientationNavigationController.swift +++ b/Sources/Classes/Controllers/BaseOrientationNavigationController.swift @@ -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 } } From f797ea2d8f3f4519583cc8ba1b27e0515559b1e5 Mon Sep 17 00:00:00 2001 From: Boyko Mihail Date: Mon, 5 Oct 2020 10:34:25 +0300 Subject: [PATCH 2/2] Update version --- CHANGELOG.md | 3 +++ LeadKit.podspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39462da1..632e8802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 0.10.8 +- **Fix**: `Add presentedOrTopViewController`. + ### 0.10.7 - **Fix**: `Add BaseOrientationController`. - **Fix**: `Add videoOrientation extension`. diff --git a/LeadKit.podspec b/LeadKit.podspec index 586a3734..249062dd 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -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"