Skip to content

Commit

Permalink
🛠 Refactor: createModalNativeEventDict Access
Browse files Browse the repository at this point in the history
Summary: Make `RNIModalView.createModalNativeEventDict` internal.
  • Loading branch information
dominicstop committed Jan 6, 2023
1 parent ced11ab commit 2dc82d1
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,33 @@ extension RNIModalView {
};
};

// MARK: - Internal Functions
// --------------------------

extension RNIModalView {

/// helper function to create a `NativeEvent` object
func createModalNativeEventDict() -> Dictionary<AnyHashable, Any> {
var dict: Dictionary<AnyHashable, Any> = [
"modalUUID" : self.modalUUID ,
"isInFocus" : self.isInFocus ,
"isPresented" : self.isPresented ,
"modalLevel" : self.modalLevel ,
"modalLevelPrev": self.modalLevelPrev,
];

if let reactTag = self.modalID {
dict["reactTag"] = reactTag;
};

if let modalID = self.modalID {
dict["modalID"] = modalID;
};

return dict;
};
};

// ----------------------------------
// MARK: Extension: Private Functions
// ----------------------------------
Expand Down Expand Up @@ -616,27 +643,6 @@ extension RNIModalView {
};
};
};

/// helper function to create a `NativeEvent` object
private func createModalNativeEventDict() -> Dictionary<AnyHashable, Any> {
var dict: Dictionary<AnyHashable, Any> = [
"modalUUID" : self.modalUUID ,
"isInFocus" : self.isInFocus ,
"isPresented" : self.isPresented ,
"modalLevel" : self.modalLevel ,
"modalLevelPrev": self.modalLevelPrev,
];

if let reactTag = self.modalID {
dict["reactTag"] = reactTag;
};

if let modalID = self.modalID {
dict["modalID"] = modalID;
};

return dict;
};
};

// ---------------------------------------------------------
Expand Down

0 comments on commit 2dc82d1

Please sign in to comment.