Skip to content

Commit 86d6f9e

Browse files
author
Geoff
committed
Fixed warning about Unbalanced calls to begin/end appearance transitions for UIViewController
1 parent caafbda commit 86d6f9e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

PasscodeLock/PasscodeLockPresenter.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class PasscodeLockPresenter {
1818

1919
window.windowLevel = 0
2020
window.makeKeyAndVisible()
21-
window.rootViewController = UIViewController()
2221

2322
return window
2423
}()
@@ -29,7 +28,7 @@ public class PasscodeLockPresenter {
2928
public init(mainWindow window: UIWindow?, configuration: PasscodeLockConfigurationType) {
3029

3130
mainWindow = window
32-
mainWindow?.windowLevel = 1
31+
mainWindow?.windowLevel = UIWindowLevelNormal
3332
passcodeConfiguration = configuration
3433
}
3534

@@ -39,7 +38,7 @@ public class PasscodeLockPresenter {
3938
guard !isPasscodePresented else { return }
4039

4140
isPasscodePresented = true
42-
passcodeLockWindow.windowLevel = 2
41+
passcodeLockWindow.windowLevel = UIWindowLevelAlert
4342

4443
let passcodeLockVC = PasscodeLockViewController(state: .EnterPasscode, configuration: passcodeConfiguration)
4544

@@ -48,7 +47,7 @@ public class PasscodeLockPresenter {
4847
self?.dismissPasscodeLock()
4948
}
5049

51-
passcodeLockWindow.rootViewController?.presentViewController(passcodeLockVC, animated: false, completion: nil)
50+
passcodeLockWindow.rootViewController = passcodeLockVC
5251
}
5352

5453
private func dismissPasscodeLock() {
@@ -57,7 +56,7 @@ public class PasscodeLockPresenter {
5756

5857
passcodeLockWindow.windowLevel = 0
5958

60-
mainWindow?.windowLevel = 1
59+
mainWindow?.windowLevel = UIWindowLevelNormal
6160
mainWindow?.makeKeyAndVisible()
6261
}
6362
}

PasscodeLock/PasscodeLockViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg
123123

124124
} else {
125125

126-
dismissViewControllerAnimated(true, completion: dismissCompletionCallback)
126+
dismissViewControllerAnimated( true, completion: nil )
127+
dismissCompletionCallback?()
127128
}
128129

129130
}

0 commit comments

Comments
 (0)