-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ios): Create tmpWindow when is needed and destroy when not needed (…
- Loading branch information
1 parent
516386e
commit 9475129
Showing
2 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
import UIKit | ||
|
||
class TmpViewController: UIViewController { | ||
var count = 0 | ||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
NotificationCenter.default.post(CAPBridge.tmpVCAppeared) | ||
// On iOS 11-12 viewDidAppear is called when TmpViewController is created and | ||
// when the presented VC gets dismissed. | ||
// On iOS 13 only when the presented VC gets dismissed. | ||
// We only want to send the notification when the presented VC gets dismissed. | ||
if #available(iOS 13, *) { | ||
count += 2 | ||
} else { | ||
count += 1 | ||
} | ||
if count > 1 { | ||
NotificationCenter.default.post(CAPBridge.tmpVCAppeared) | ||
} | ||
} | ||
} |