Skip to content

Commit

Permalink
Fixed the issue when the modal view controller could considered as to…
Browse files Browse the repository at this point in the history
…p one in UINavigationController
  • Loading branch information
ekazaev committed Apr 18, 2019
1 parent 2dcdcf5 commit 4c37c2e
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion RouteComposer.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RouteComposer'
s.version = '1.5.2'
s.version = '1.5.3'
s.summary = 'Protocol oriented library that helps to handle view controllers composition, navigation and deep linking tasks.'

s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ extension UINavigationController: ContainerViewController {
}

public var visibleViewControllers: [UIViewController] {
guard let visibleViewController = visibleViewController else {
guard let topViewController = topViewController else {
return []
}
return [visibleViewController]
return [topViewController]
}

public func makeVisible(_ viewController: UIViewController, animated: Bool) {
guard visibleViewController != viewController,
guard topViewController != viewController,
let viewControllerToMakeVisible = containedViewControllers.first(where: { $0 == viewController }) else {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension UISplitViewController: ContainerViewController {
return
}
if isCollapsed {
guard viewController.navigationController?.visibleViewController != viewController else {
guard viewController.navigationController?.topViewController != viewController else {
return
}
viewController.navigationController?.popToViewController(viewController, animated: animated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ extension UITabBarController: ContainerViewController {
}

public var visibleViewControllers: [UIViewController] {
guard let visibleViewController = selectedViewController else {
guard let selectedViewController = selectedViewController else {
return []
}
return [visibleViewController]
return [selectedViewController]
}

public func makeVisible(_ viewController: UIViewController, animated: Bool) {
Expand Down
14 changes: 7 additions & 7 deletions docs/tests/Array+Extension.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,37 +150,37 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/Array+Extension.swift<
<tr class="covered">
<td class="num">28</td>
<td class="src"><pre><code class="objc"> func uniqueElements() -&gt; [Element] {</code></pre></td>
<td class="coverage">553x</td>
<td class="coverage">541x</td>
</tr>
<tr class="covered">
<td class="num">29</td>
<td class="src"><pre><code class="objc"> return self.reduce(into: [Element](), {</code></pre></td>
<td class="coverage">988x</td>
<td class="coverage">964x</td>
</tr>
<tr class="covered">
<td class="num">30</td>
<td class="src"><pre><code class="objc"> if !$0.contains($1) {</code></pre></td>
<td class="coverage">988x</td>
<td class="coverage">964x</td>
</tr>
<tr class="covered">
<td class="num">31</td>
<td class="src"><pre><code class="objc"> $0.append($1)</code></pre></td>
<td class="coverage">719x</td>
<td class="coverage">679x</td>
</tr>
<tr class="covered">
<td class="num">32</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">988x</td>
<td class="coverage">964x</td>
</tr>
<tr class="covered">
<td class="num">33</td>
<td class="src"><pre><code class="objc"> })</code></pre></td>
<td class="coverage">988x</td>
<td class="coverage">964x</td>
</tr>
<tr class="covered">
<td class="num">34</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">553x</td>
<td class="coverage">541x</td>
</tr>
<tr class="never">
<td class="num">35</td>
Expand Down
6 changes: 3 additions & 3 deletions docs/tests/NavigationController+Extension.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/NavigationController+E
</tr>
<tr class="covered">
<td class="num">17</td>
<td class="src"><pre><code class="objc"> guard let visibleViewController = visibleViewController else {</code></pre></td>
<td class="src"><pre><code class="objc"> guard let topViewController = topViewController else {</code></pre></td>
<td class="coverage">283x</td>
</tr>
<tr class="missed">
Expand All @@ -109,7 +109,7 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/NavigationController+E
</tr>
<tr class="covered">
<td class="num">20</td>
<td class="src"><pre><code class="objc"> return [visibleViewController]</code></pre></td>
<td class="src"><pre><code class="objc"> return [topViewController]</code></pre></td>
<td class="coverage">283x</td>
</tr>
<tr class="covered">
Expand All @@ -129,7 +129,7 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/NavigationController+E
</tr>
<tr class="covered">
<td class="num">24</td>
<td class="src"><pre><code class="objc"> guard visibleViewController != viewController,</code></pre></td>
<td class="src"><pre><code class="objc"> guard topViewController != viewController,</code></pre></td>
<td class="coverage">43x</td>
</tr>
<tr class="covered">
Expand Down
20 changes: 10 additions & 10 deletions docs/tests/RoutingError.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<body>
<header><div class="row"><a href="index.html"><img src="logo.jpg" alt="Slather logo"></a></div></header><div class="row"><div id="reports">
<h2 class="cov_title">
<span>Coverage for "RoutingError.swift" : </span><span class="cov_high">88.89%</span>
<span>Coverage for "RoutingError.swift" : </span><span class="cov_high">100.00%</span>
</h2>
<h4 class="cov_subtitle">(32 of 36 relevant lines covered)</h4>
<h4 class="cov_subtitle">(36 of 36 relevant lines covered)</h4>
<h4 class="cov_filepath">RouteComposer/Classes/RoutingError.swift</h4>
<table class="source_code">
<tr class="never">
Expand Down Expand Up @@ -212,25 +212,25 @@ <h4 class="cov_filepath">RouteComposer/Classes/RoutingError.swift</h4>
<td class="src"><pre><code class="objc"> /// Constructor</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="missed">
<tr class="covered">
<td class="num">41</td>
<td class="src"><pre><code class="objc"> public init(_ debugDescription: String, underlyingError: Error? = nil) {</code></pre></td>
<td class="coverage">!</td>
<td class="coverage">40x</td>
</tr>
<tr class="missed">
<tr class="covered">
<td class="num">42</td>
<td class="src"><pre><code class="objc"> self.debugDescription = debugDescription</code></pre></td>
<td class="coverage">!</td>
<td class="coverage">40x</td>
</tr>
<tr class="missed">
<tr class="covered">
<td class="num">43</td>
<td class="src"><pre><code class="objc"> self.underlyingError = underlyingError</code></pre></td>
<td class="coverage">!</td>
<td class="coverage">40x</td>
</tr>
<tr class="missed">
<tr class="covered">
<td class="num">44</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">!</td>
<td class="coverage">40x</td>
</tr>
<tr class="never">
<td class="num">45</td>
Expand Down
6 changes: 3 additions & 3 deletions docs/tests/SearchOptions.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ <h4 class="cov_filepath">RouteComposer/Classes/SearchOptions.swift</h4>
<tr class="covered">
<td class="num">12</td>
<td class="src"><pre><code class="objc"> public init(rawValue: Int) {</code></pre></td>
<td class="coverage">17700x</td>
<td class="coverage">17000x</td>
</tr>
<tr class="covered">
<td class="num">13</td>
<td class="src"><pre><code class="objc"> self.rawValue = rawValue</code></pre></td>
<td class="coverage">17700x</td>
<td class="coverage">17000x</td>
</tr>
<tr class="covered">
<td class="num">14</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">17700x</td>
<td class="coverage">17000x</td>
</tr>
<tr class="never">
<td class="num">15</td>
Expand Down
2 changes: 1 addition & 1 deletion docs/tests/SplitViewController+Extension.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/SplitViewController+Ex
</tr>
<tr class="covered">
<td class="num">30</td>
<td class="src"><pre><code class="objc"> guard viewController.navigationController?.visibleViewController != viewController else {</code></pre></td>
<td class="src"><pre><code class="objc"> guard viewController.navigationController?.topViewController != viewController else {</code></pre></td>
<td class="coverage">3x</td>
</tr>
<tr class="missed">
Expand Down
10 changes: 5 additions & 5 deletions docs/tests/StackIteratingFinder.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,22 @@ <h4 class="cov_filepath">RouteComposer/Classes/Finders/StackIteratingFinder.swif
<tr class="covered">
<td class="num">35</td>
<td class="src"><pre><code class="objc"> let predicate: (UIViewController) -&gt; Bool = {</code></pre></td>
<td class="coverage">599x</td>
<td class="coverage">559x</td>
</tr>
<tr class="covered">
<td class="num">36</td>
<td class="src"><pre><code class="objc"> guard let viewController = $0 as? ViewController else {</code></pre></td>
<td class="coverage">599x</td>
<td class="coverage">559x</td>
</tr>
<tr class="covered">
<td class="num">37</td>
<td class="src"><pre><code class="objc"> return false</code></pre></td>
<td class="coverage">532x</td>
<td class="coverage">492x</td>
</tr>
<tr class="covered">
<td class="num">38</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">532x</td>
<td class="coverage">492x</td>
</tr>
<tr class="covered">
<td class="num">39</td>
Expand All @@ -210,7 +210,7 @@ <h4 class="cov_filepath">RouteComposer/Classes/Finders/StackIteratingFinder.swif
<tr class="covered">
<td class="num">40</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">599x</td>
<td class="coverage">559x</td>
</tr>
<tr class="covered">
<td class="num">41</td>
Expand Down
24 changes: 12 additions & 12 deletions docs/tests/TabBarViewController+Extension.swift.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/TabBarViewController+E
<tr class="covered">
<td class="num">12</td>
<td class="src"><pre><code class="objc"> public var containedViewControllers: [UIViewController] {</code></pre></td>
<td class="coverage">211x</td>
<td class="coverage">201x</td>
</tr>
<tr class="covered">
<td class="num">13</td>
<td class="src"><pre><code class="objc"> guard let viewControllers = self.viewControllers else {</code></pre></td>
<td class="coverage">211x</td>
<td class="coverage">201x</td>
</tr>
<tr class="missed">
<td class="num">14</td>
Expand All @@ -85,17 +85,17 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/TabBarViewController+E
<tr class="covered">
<td class="num">15</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">211x</td>
<td class="coverage">201x</td>
</tr>
<tr class="covered">
<td class="num">16</td>
<td class="src"><pre><code class="objc"> return viewControllers</code></pre></td>
<td class="coverage">211x</td>
<td class="coverage">201x</td>
</tr>
<tr class="covered">
<td class="num">17</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">211x</td>
<td class="coverage">201x</td>
</tr>
<tr class="never">
<td class="num">18</td>
Expand All @@ -105,12 +105,12 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/TabBarViewController+E
<tr class="covered">
<td class="num">19</td>
<td class="src"><pre><code class="objc"> public var visibleViewControllers: [UIViewController] {</code></pre></td>
<td class="coverage">235x</td>
<td class="coverage">225x</td>
</tr>
<tr class="covered">
<td class="num">20</td>
<td class="src"><pre><code class="objc"> guard let visibleViewController = selectedViewController else {</code></pre></td>
<td class="coverage">235x</td>
<td class="src"><pre><code class="objc"> guard let selectedViewController = selectedViewController else {</code></pre></td>
<td class="coverage">225x</td>
</tr>
<tr class="missed">
<td class="num">21</td>
Expand All @@ -120,17 +120,17 @@ <h4 class="cov_filepath">RouteComposer/Classes/Extensions/TabBarViewController+E
<tr class="covered">
<td class="num">22</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">235x</td>
<td class="coverage">225x</td>
</tr>
<tr class="covered">
<td class="num">23</td>
<td class="src"><pre><code class="objc"> return [visibleViewController]</code></pre></td>
<td class="coverage">235x</td>
<td class="src"><pre><code class="objc"> return [selectedViewController]</code></pre></td>
<td class="coverage">225x</td>
</tr>
<tr class="covered">
<td class="num">24</td>
<td class="src"><pre><code class="objc"> }</code></pre></td>
<td class="coverage">235x</td>
<td class="coverage">225x</td>
</tr>
<tr class="never">
<td class="num">25</td>
Expand Down
Loading

0 comments on commit 4c37c2e

Please sign in to comment.