mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Handles iOS 13 dismiss gesture when signing in
This commit is contained in:
@@ -36,6 +36,7 @@ class AuthenticationOperation: ResultOperation<ALTSigner>
|
||||
|
||||
private lazy var navigationController: UINavigationController = {
|
||||
let navigationController = self.storyboard.instantiateViewController(withIdentifier: "navigationController") as! UINavigationController
|
||||
navigationController.presentationController?.delegate = self
|
||||
return navigationController
|
||||
}()
|
||||
|
||||
@@ -44,6 +45,8 @@ class AuthenticationOperation: ResultOperation<ALTSigner>
|
||||
private var appleIDPassword: String?
|
||||
private var shouldShowInstructions = false
|
||||
|
||||
private var signer: ALTSigner?
|
||||
|
||||
init(presentingViewController: UIViewController?)
|
||||
{
|
||||
self.presentingViewController = presentingViewController
|
||||
@@ -87,8 +90,10 @@ class AuthenticationOperation: ResultOperation<ALTSigner>
|
||||
case .success(let certificate):
|
||||
self.progress.completedUnitCount += 1
|
||||
|
||||
let signer = ALTSigner(team: team, certificate: certificate)
|
||||
self.signer = signer
|
||||
|
||||
self.showInstructionsIfNecessary() { (didShowInstructions) in
|
||||
let signer = ALTSigner(team: team, certificate: certificate)
|
||||
self.finish(.success(signer))
|
||||
}
|
||||
}
|
||||
@@ -388,3 +393,18 @@ private extension AuthenticationOperation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension AuthenticationOperation: UIAdaptivePresentationControllerDelegate
|
||||
{
|
||||
func presentationControllerWillDismiss(_ presentationController: UIPresentationController)
|
||||
{
|
||||
if let signer = self.signer
|
||||
{
|
||||
self.finish(.success(signer))
|
||||
}
|
||||
else
|
||||
{
|
||||
self.finish(.failure(OperationError.cancelled))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user