Forked from mtsd/UINavigationController+extensions.swift
Created
September 23, 2023 19:00
-
-
Save gopalkohli/92d790f180af859139833d14abd29fc8 to your computer and use it in GitHub Desktop.
Completion handler for UINavigationController push or pop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if DEBUG | |
| import UIKit | |
| extension UIWindow { | |
| // WARNING: UIWindowのモーションジェスチャーを奪ってるので、利用する場合は要対応 | |
| override open func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { | |
| guard motion == .motionShake else { return } | |
| let vc = UIViewController() | |
| guard vc.parent == nil, | |
| rootViewController?.presentedViewController == nil | |
| else { return } | |
| let navi = UINavigationController(rootViewController: vc) | |
| rootViewController?.present(navi, animated: true, completion: nil) | |
| } | |
| } | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment