From 1332601c06005d465dba9620e91171f48f36e410 Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Thu, 27 Apr 2023 02:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20Refactor:=20Split=20`RNIViewCont?= =?UTF-8?q?rollerLifeCycleNotifiable`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Extract extension in `RNIViewControllerLifeCycleNotifiable` into its own file in `ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable`. --- ...ontrollerLifeCycleNotifiable+Default.swift | 42 +++++++++++++++++++ ...RNIViewControllerLifeCycleNotifiable.swift | 33 --------------- 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable+Default.swift diff --git a/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable+Default.swift b/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable+Default.swift new file mode 100644 index 00000000..ff6e139b --- /dev/null +++ b/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable+Default.swift @@ -0,0 +1,42 @@ +// +// RNIViewControllerLifeCycleNotifiable+Default.swift +// react-native-ios-modal +// +// Created by Dominic Go on 4/27/23. +// + +import Foundation + +extension RNIViewControllerLifeCycleNotifiable { + public func viewDidLoad(sender: UIViewController) { + // no-op + }; + + public func viewDidLayoutSubviews(sender: UIViewController) { + // no-op + }; + + public func viewWillAppear(sender: UIViewController, animated: Bool) { + // no-op + }; + + public func viewDidAppear(sender: UIViewController, animated: Bool) { + // no-op + }; + + public func viewWillDisappear(sender: UIViewController, animated: Bool) { + // no-op + }; + + public func viewDidDisappear(sender: UIViewController, animated: Bool) { + // no-op + }; + + public func willMove(sender: UIViewController, toParent parent: UIViewController?) { + // no-op + }; + + public func didMove(sender: UIViewController, toParent parent: UIViewController?) { + // no-op + }; +}; diff --git a/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable.swift b/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable.swift index 7cac0132..d349bdde 100644 --- a/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable.swift +++ b/ios/src_library/React Native/RNIViewControllerLifeCycleNotifiable/RNIViewControllerLifeCycleNotifiable.swift @@ -33,36 +33,3 @@ public protocol RNIViewControllerLifeCycleNotifiable: AnyObject { }; -extension RNIViewControllerLifeCycleNotifiable { - public func viewDidLoad(sender: UIViewController) { - // no-op - }; - - public func viewDidLayoutSubviews(sender: UIViewController) { - // no-op - }; - - public func viewWillAppear(sender: UIViewController, animated: Bool) { - // no-op - }; - - public func viewDidAppear(sender: UIViewController, animated: Bool) { - // no-op - }; - - public func viewWillDisappear(sender: UIViewController, animated: Bool) { - // no-op - }; - - public func viewDidDisappear(sender: UIViewController, animated: Bool) { - // no-op - }; - - public func willMove(sender: UIViewController, toParent parent: UIViewController?) { - // no-op - }; - - public func didMove(sender: UIViewController, toParent parent: UIViewController?) { - // no-op - }; -};