Skip to content

Commit

Permalink
🛠 Refactor: Rename to CompletionHandler
Browse files Browse the repository at this point in the history
Summary: Rename `RNIModalView.completionResult` to `CompletionHandler`.
  • Loading branch information
dominicstop committed Jan 6, 2023
1 parent 3e02b7e commit 723ccd2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/src_library/React Native/RNIModalView/RNIModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation

class RNIModalView: UIView {

typealias completionResult = ((_ isSuccess: Bool, _ error: RNIModalViewError?) -> ())?;
typealias CompletionHandler = (_ isSuccess: Bool, _ error: RNIModalViewError?) -> Void

struct DefaultValues {
static let presentationStyle: UIModalPresentationStyle = {
Expand Down Expand Up @@ -317,7 +317,7 @@ class RNIModalView: UIView {

extension RNIModalView {

public func presentModal(completion: completionResult = nil) {
public func presentModal(completion: CompletionHandler? = nil) {
let hasWindow: Bool = (self.window != nil);

guard (hasWindow && !self.isPresented),
Expand Down Expand Up @@ -378,7 +378,7 @@ extension RNIModalView {
};
};

public func dismissModal(completion: completionResult = nil) {
public func dismissModal(completion: CompletionHandler? = nil) {
guard self.isPresented,
let modalVC = self.modalVC
else {
Expand Down Expand Up @@ -442,7 +442,7 @@ extension RNIModalView {
public func requestModalPresentation(
_ requestID : NSNumber,
_ visibility: Bool ,
completion: completionResult = nil
completion: CompletionHandler? = nil
){
var params: Dictionary<AnyHashable, Any> = [
"requestID" : requestID ,
Expand Down Expand Up @@ -471,7 +471,7 @@ extension RNIModalView {

public func requestModalInfo(
_ requestID : NSNumber,
completion: completionResult = nil
completion: CompletionHandler? = nil
){
var params = self.createModalNativeEventDict();
params["success" ] = true;
Expand Down

0 comments on commit 723ccd2

Please sign in to comment.