Skip to content

Commit

Permalink
⭐️ Impl: ViewControllerLifecycleNotifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Sep 26, 2024
1 parent 717ff68 commit 6cbdee4
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions ios/Temp/ViewControllerLifecycleNotifiable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
//
// ViewControllerLifecycleNotifiable.swift
// react-native-ios-modal
//
// Created by Dominic Go on 9/27/24.
//

import UIKit


public protocol ViewControllerLifecycleNotifiable: AnyObject {

func notifyOnViewDidLoad(sender: UIViewController);

func notifyOnViewWillAppear(
sender: UIViewController,
isAnimated: Bool
);

func notifyOnViewIsAppearing(
sender: UIViewController,
isAnimated: Bool
);

func notifyOnViewDidAppear(
sender: UIViewController,
isAnimated: Bool
);

func notifyOnViewWillDisappear(
sender: UIViewController,
isAnimated: Bool
);

func notifyOnViewDidDisappear(
sender: UIViewController,
isAnimated: Bool
);

func notifyOnViewWillLayoutSubviews(
sender: UIViewController
);

func notifyOnViewDidLayoutSubviews(
sender: UIViewController
);
};

// MARK: - ViewControllerLifecycleNotifiable+Default
// -------------------------------------------------

public extension ViewControllerLifecycleNotifiable {

func notifyOnViewDidLoad(sender: UIViewController) {
// no-op
};

func notifyOnViewWillAppear(
sender: UIViewController,
isAnimated: Bool
) {
// no-op
};

func notifyOnViewIsAppearing(
sender: UIViewController,
isAnimated: Bool
) {
// no-op
};

func notifyOnViewDidAppear(
sender: UIViewController,
isAnimated: Bool
) {
// no-op
};

func notifyOnViewWillDisappear(
sender: UIViewController,
isAnimated: Bool
) {
// no-op
};

func notifyOnViewDidDisappear(
sender: UIViewController,
isAnimated: Bool
) {
// no-op
};

func notifyOnViewWillLayoutSubviews(
sender: UIViewController
) {
// no-op
};

func notifyOnViewDidLayoutSubviews(
sender: UIViewController
) {
// no-op
};
};

0 comments on commit 6cbdee4

Please sign in to comment.