@@ -93,8 +93,9 @@ open class CapacitorBridge: NSObject, CAPBridgeProtocol {
9393 }
9494 }
9595 }
96-
96+ @ available ( * , deprecated , message : " obsolete " )
9797 var tmpWindow : UIWindow ?
98+ @available ( * , deprecated, message: " obsolete " )
9899 static let tmpVCAppeared = Notification ( name: Notification . Name ( rawValue: " tmpViewControllerAppeared " ) )
99100 public static let capacitorSite = " https://capacitorjs.com/ "
100101 public static let fileStartIdentifier = " /_capacitor_file_ "
@@ -747,22 +748,10 @@ open class CapacitorBridge: NSObject, CAPBridgeProtocol {
747748 }
748749
749750 @objc open func presentVC( _ viewControllerToPresent: UIViewController , animated flag: Bool , completion: ( ( ) -> Void ) ? = nil ) {
750- if viewControllerToPresent. modalPresentationStyle == . popover {
751- self . viewController? . present ( viewControllerToPresent, animated: flag, completion: completion)
752- } else {
753- self . tmpWindow = UIWindow . init ( frame: UIScreen . main. bounds)
754- self . tmpWindow? . rootViewController = TmpViewController . init ( )
755- self . tmpWindow? . makeKeyAndVisible ( )
756- self . tmpWindow? . rootViewController? . present ( viewControllerToPresent, animated: flag, completion: completion)
757- }
751+ self . viewController? . present ( viewControllerToPresent, animated: flag, completion: completion)
758752 }
759753
760754 @objc open func dismissVC( animated flag: Bool , completion: ( ( ) -> Void ) ? = nil ) {
761- if self . tmpWindow == nil {
762- self . viewController? . dismiss ( animated: flag, completion: completion)
763- } else {
764- self . tmpWindow? . rootViewController? . dismiss ( animated: flag, completion: completion)
765- self . tmpWindow = nil
766- }
755+ self . viewController? . dismiss ( animated: flag, completion: completion)
767756 }
768757}
0 commit comments