-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related: * `TODO:2023-03-31-18-33-34` - Unify/streamline/consolidate logic for invoking modal focus/blur. * `TODO:2023-03-31-18-37-00` - Impl. `RNIViewControllerLifeCycleNotifiable` protocol.
- Loading branch information
1 parent
aba3a07
commit 3fc35b3
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
ios/src_library/Helpers+Utilities/RNIViewControllerLifeCycleNotifiable.swift
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// RNIViewControllerLifeCycleNotifiable.swift | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 4/1/23. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol RNIViewControllerLifeCycleNotifiable: AnyObject { | ||
|
||
func viewDidLoad(sender: UIViewController); | ||
|
||
func viewDidLayoutSubviews(sender: UIViewController); | ||
|
||
func viewWillAppear(sender: UIViewController, animated: Bool); | ||
|
||
func viewDidAppear(sender: UIViewController, animated: Bool); | ||
|
||
/// `Note:2023-04-01-14-39-23` | ||
/// | ||
/// * `UIViewController.isBeingDismissed` or | ||
/// `UIViewController.isMovingFromParent` are `true` during | ||
/// `viewWillDisappear`, whenever a modal is about to be dismissed. | ||
/// | ||
func viewWillDisappear(sender: UIViewController, animated: Bool); | ||
|
||
func viewDidDisappear(sender: UIViewController, animated: Bool); | ||
|
||
func willMove(sender: UIViewController, toParent parent: UIViewController?); | ||
|
||
func didMove(sender: UIViewController, toParent parent: UIViewController?); | ||
|
||
}; | ||
|
||
extension RNIViewControllerLifeCycleNotifiable { | ||
func viewDidLoad(sender: UIViewController) { | ||
// no-op | ||
}; | ||
|
||
func viewDidLayoutSubviews(sender: UIViewController) { | ||
// no-op | ||
}; | ||
|
||
func viewWillAppear(sender: UIViewController, animated: Bool) { | ||
// no-op | ||
}; | ||
|
||
func viewDidAppear(sender: UIViewController, animated: Bool) { | ||
// no-op | ||
}; | ||
|
||
func viewWillDisappear(sender: UIViewController, animated: Bool) { | ||
// no-op | ||
}; | ||
|
||
func viewDidDisappear(sender: UIViewController, animated: Bool) { | ||
// no-op | ||
}; | ||
|
||
func willMove(sender: UIViewController, toParent parent: UIViewController?) { | ||
// no-op | ||
}; | ||
|
||
func didMove(sender: UIViewController, toParent parent: UIViewController?) { | ||
// no-op | ||
}; | ||
}; |