Skip to content

Commit

Permalink
[iOS] [14075] Fixes deep linking UI transitioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
gcutrini committed Jul 18, 2018
1 parent a7a3056 commit 93cf273
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions OpenStack Summit/OpenStack Summit/LaunchScreenViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ final class LaunchScreenViewController: UIViewController, MessageEnabledViewCont

private var digitLabels = [UILabel]()

private var willTransition = false {

didSet { configureView() }
}
private var deepLinking = false

private var state: State = .loadingSummits {

Expand Down Expand Up @@ -281,12 +278,8 @@ final class LaunchScreenViewController: UIViewController, MessageEnabledViewCont

private func showRevealController(_ sender: AnyObject? = nil, delay: Double = 0, completion: ((MainRevealViewController) -> ())? = nil) {

self.willTransition = true

let revealViewController = MainRevealViewController()

self.willTransition = false

DispatchQueue.main.asyncAfter(deadline: dispatchTime(from: delay)) {

self.show(revealViewController, sender: sender)
Expand Down Expand Up @@ -342,14 +335,12 @@ final class LaunchScreenViewController: UIViewController, MessageEnabledViewCont
controller.summit = latestSummit

#if DEBUG

if SummitManager.shared.summit.value == 0 {

SummitManager.shared.summit.value = latestSummit.identifier
}
#else
if SummitManager.shared.summit.value == 0 {

SummitManager.shared.summit.value = latestSummit.identifier
}
#else
SummitManager.shared.summit.value = latestSummit.identifier
#endif

controller.loadData()
Expand All @@ -365,9 +356,9 @@ final class LaunchScreenViewController: UIViewController, MessageEnabledViewCont

if Store.shared.isLoggedIn {

showRevealController(self, delay: 2)

state = .transitioning

if !deepLinking { showRevealController(self, delay: 2) }
}
else {

Expand Down Expand Up @@ -414,16 +405,24 @@ final class LaunchScreenViewController: UIViewController, MessageEnabledViewCont

func view(data: AppActivitySummitDataType, identifier: Identifier) {

showRevealController(self) { $0.view(data: data, identifier: identifier) }
deepLinking = true

showRevealController(self) {
$0.view(data: data, identifier: identifier)
}
}

func view(screen: AppActivityScreen) {

deepLinking = true

showRevealController(self) { $0.view(screen: screen) }
}

func search(_ searchTerm: String) {

deepLinking = true

showRevealController(self) { $0.search(searchTerm) }
}

Expand Down

0 comments on commit 93cf273

Please sign in to comment.