Skip to content

Commit

Permalink
💫 Update: RNIModalRequestable
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed May 13, 2023
1 parent 5d5167e commit 77c3a73
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
16 changes: 8 additions & 8 deletions ios/src_library/React Native/RNIModal/RNIModal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public protocol RNIModalState: AnyObject {
public protocol RNIModalRequestable: AnyObject {

func requestModalToShow(
sender: any RNIModal,
onRequestApprovedBlock: () -> Void,
onRequestDeniedBlock: (_ reason: String) -> Void
);
sender: Any,
animated: Bool,
completion: @escaping () -> Void
) throws;

func requestModalToHide(
sender: any RNIModal,
onRequestApprovedBlock: () -> Void,
onRequestDeniedBlock: (_ reason: String) -> Void
);
sender: Any,
animated: Bool,
completion: @escaping () -> Void
) throws;
};

/// Contains functions that get called whenever a modal-related event occurs.
Expand Down
22 changes: 10 additions & 12 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1091,21 +1091,19 @@ extension RNIModalView: UISheetPresentationControllerDelegate {
extension RNIModalView: RNIModalRequestable {

public func requestModalToShow(
sender: any RNIModal,
onRequestApprovedBlock: () -> Void,
onRequestDeniedBlock: (String) -> Void
) {
/// `TODO:2023-03-24-09-58-50` - Refactor `RNIModalView` to use `RNIModalManager`.
/// No-op - TBA
sender: Any,
animated: Bool,
completion: @escaping () -> Void
) throws {
try self.presentModal(completion: completion);
};

public func requestModalToHide(
sender: any RNIModal,
onRequestApprovedBlock: () -> Void,
onRequestDeniedBlock: (String) -> Void
) {
/// `TODO:2023-03-24-09-58-50` - Refactor `RNIModalView` to use `RNIModalManager`.
/// No-op - TBA
sender: Any,
animated: Bool,
completion: @escaping () -> Void
) throws {
try self.dismissModal(completion: completion);
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public class RNIModalViewControllerWrapper:
extension RNIModalViewControllerWrapper: RNIModalRequestable {

public func requestModalToShow(
sender: any RNIModal,
onRequestApprovedBlock: () -> Void,
onRequestDeniedBlock: (String) -> Void
sender: Any,
animated: Bool,
completion: @escaping () -> Void
) {
// TBA - no-op
};

public func requestModalToHide(
sender: any RNIModal,
onRequestApprovedBlock: () -> Void,
onRequestDeniedBlock: (String) -> Void
sender: Any,
animated: Bool,
completion: @escaping () -> Void
) {
// TBA - no-op
};
Expand Down

0 comments on commit 77c3a73

Please sign in to comment.