Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation
import UIKit

/// A VC with a loading spinner at its view center.
class LoadingViewController: UIViewController {
class SwiftyDropboxLoadingViewController: UIViewController {
private let loadingSpinner: UIActivityIndicatorView

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,15 +617,15 @@ public class MobileSharedApplication: SharedApplication {
/// Web OAuth flow, present the spinner over the MobileSafariViewController.
private func presentLoadingInWeb() {
let safariViewController = controller?.presentedViewController as? MobileSafariViewController
let loadingVC = LoadingViewController(nibName: nil, bundle: nil)
let loadingVC = SwiftyDropboxLoadingViewController(nibName: nil, bundle: nil)
loadingVC.modalPresentationStyle = .overFullScreen
safariViewController?.present(loadingVC, animated: false)
}

// Web OAuth flow, dismiss loading view on the MobileSafariViewController.
private func dismissLoadingInWeb() {
let safariViewController = controller?.presentedViewController as? MobileSafariViewController
let loadingView = safariViewController?.presentedViewController as? LoadingViewController
let loadingView = safariViewController?.presentedViewController as? SwiftyDropboxLoadingViewController
loadingView?.dismiss(animated: false)
}

Expand All @@ -635,7 +635,7 @@ public class MobileSharedApplication: SharedApplication {
if let loadingStatusDelegate = loadingStatusDelegate {
loadingStatusDelegate.showLoading()
} else {
let loadingVC = LoadingViewController(nibName: nil, bundle: nil)
let loadingVC = SwiftyDropboxLoadingViewController(nibName: nil, bundle: nil)
loadingVC.modalPresentationStyle = .overFullScreen
controller?.present(loadingVC, animated: false)
}
Expand All @@ -646,7 +646,7 @@ public class MobileSharedApplication: SharedApplication {
private func dismissLoadingInApp() {
if let loadingStatusDelegate = loadingStatusDelegate {
loadingStatusDelegate.dismissLoading()
} else if let loadingView = controller?.presentedViewController as? LoadingViewController {
} else if let loadingView = controller?.presentedViewController as? SwiftyDropboxLoadingViewController {
loadingView.dismiss(animated: false)
}
}
Expand Down
Loading