@@ -27,19 +27,7 @@ import Cordova
2727 return false
2828 } ( )
2929
30- // TODO: Remove in Capacitor 8 after moving status bar plugin extensions code
31- @objc func handleViewDidAppear( ) {
32- if bridge? . config. hasInitialFocus ?? true {
33- self . webView? . becomeFirstResponder ( )
34- }
35- }
36-
37- deinit {
38- NotificationCenter . default. removeObserver ( self )
39- }
40-
4130 override public final func loadView( ) {
42- NotificationCenter . default. addObserver ( self , selector: #selector( self . handleViewDidAppear) , name: Notification . Name ( rawValue: " CapacitorViewDidAppear " ) , object: nil )
4331 // load the configuration and set the logging flag
4432 let configDescriptor = instanceDescriptor ( )
4533 let configuration = InstanceConfiguration ( with: configDescriptor, isDebug: CapacitorBridge . isDevEnvironment)
@@ -76,11 +64,17 @@ import Cordova
7664
7765 override open func viewDidAppear( _ animated: Bool ) {
7866 super. viewDidAppear ( animated)
67+ NotificationCenter . default. post ( Notification ( name: . capacitorViewDidAppear) )
7968 if bridge? . config. hasInitialFocus ?? true {
8069 self . webView? . becomeFirstResponder ( )
8170 }
8271 }
8372
73+ override open func viewWillTransition( to size: CGSize , with coordinator: UIViewControllerTransitionCoordinator ) {
74+ super. viewWillTransition ( to: size, with: coordinator)
75+ NotificationCenter . default. post ( Notification ( name: . capacitorViewWillTransition) )
76+ }
77+
8478 override open func canPerformUnwindSegueAction( _ action: Selector , from fromViewController: UIViewController , withSender sender: Any ) -> Bool {
8579 return false
8680 }
0 commit comments