Skip to content

Commit

Permalink
⭐️ Impl: Add RNIModalViewController
Browse files Browse the repository at this point in the history
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
dominicstop committed Apr 5, 2023
1 parent aba3a07 commit 3fc35b3
Showing 1 changed file with 68 additions and 0 deletions.
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
};
};

0 comments on commit 3fc35b3

Please sign in to comment.