Skip to content

Commit 92a0cd1

Browse files
committed
Access to Expandable conforming VCs tabBarController instead of accessing from UIApplication
1 parent 418a545 commit 92a0cd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SampleSporify/ExpandableViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public protocol Expandable: UIViewController {
1616
public extension Expandable {
1717
var expander: StickyViewControllerSupporting? {
1818
get {
19-
if let tabBarController = UIApplication.shared.keyWindow?.rootViewController as? StickyViewControllerSupporting {
19+
if let tabBarController = tabBarController as? StickyViewControllerSupporting {
2020
return tabBarController
2121
} else {
2222
return nil
@@ -136,7 +136,7 @@ internal class ExpandableViewController: UIViewController {
136136
private func animateTransitionIfNeeded(isEnlarging: Bool, duration: TimeInterval) {
137137
if runningAnimation == nil {
138138
runningAnimation = UIViewPropertyAnimator(duration: duration,
139-
dampingRatio: 1) {
139+
dampingRatio: 1) {
140140
if isEnlarging {
141141
self.heightConstraint.constant = self.deviceHeight - (self.tabController?.tabBar.frame.height ?? 0.0)
142142
self.minimisedView.alpha = 0.0

0 commit comments

Comments
 (0)