Skip to content

Commit b54c781

Browse files
authored
Router embed navigation controller as open (#102)
* embedNavigationController function is now declared as open * Bump version to 1.3.1
1 parent d6d34a9 commit b54c781

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Viperit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
Pod::Spec.new do |s|
44
s.name = 'Viperit'
5-
s.version = '1.3.0'
5+
s.version = '1.3.1'
66
s.summary = 'Viper Framework for iOS written in Swift'
77

88
s.description = <<-DESC

Viperit/Core/Router.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ open class Router: RouterProtocol {
3131
return _presenter._view
3232
}
3333

34+
open func embedInNavigationController() -> UINavigationController {
35+
return getNavigationController() ?? UINavigationController(rootViewController: _view as! UIViewController)
36+
}
37+
3438
open func show(inWindow window: UIWindow?, embedInNavController: Bool = false, setupData: Any? = nil, makeKeyAndVisible: Bool = true) {
3539
process(setupData: setupData)
3640
let view = embedInNavController ? embedInNavigationController() : _view as? UIViewController
@@ -77,9 +81,9 @@ private extension Router {
7781
}
7882
}
7983

80-
//MARK: - Embed view in navigation controller
81-
public extension Router {
82-
private func getNavigationController() -> UINavigationController? {
84+
//MARK: - Get navigation controller helper
85+
private extension Router {
86+
func getNavigationController() -> UINavigationController? {
8387
guard let view = _view as? UIViewController else { return nil }
8488
if let nav = view.navigationController {
8589
return nav
@@ -90,10 +94,6 @@ public extension Router {
9094
}
9195
return nil
9296
}
93-
94-
func embedInNavigationController() -> UINavigationController {
95-
return getNavigationController() ?? UINavigationController(rootViewController: _view as! UIViewController)
96-
}
9797
}
9898

9999
//MARK: - Embed view in a container view

Viperit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.3.0</string>
18+
<string>1.3.1</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
<key>LSRequiresIPhoneOS</key>

0 commit comments

Comments
 (0)