From a6b905e60d1b3ebadd2668d30db355a205899fb3 Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Wed, 10 May 2023 16:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E2=AD=90=EF=B8=8F=20Impl:=20Add=20`RNIGenericE?= =?UTF-8?q?rrorDefaultable+Default`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RNIError/RNIGenericErrorCode.swift | 4 +- .../RNIGenericErrorDefaultable+Default.swift | 42 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 ios/src_library/React Native/RNIError/RNIGenericErrorDefaultable+Default.swift diff --git a/ios/src_library/React Native/RNIError/RNIGenericErrorCode.swift b/ios/src_library/React Native/RNIError/RNIGenericErrorCode.swift index 428cbc52..a4adcced 100644 --- a/ios/src_library/React Native/RNIError/RNIGenericErrorCode.swift +++ b/ios/src_library/React Native/RNIError/RNIGenericErrorCode.swift @@ -11,6 +11,6 @@ import Foundation public enum RNIGenericErrorCode: String, Codable, CaseIterable, RNIGenericErrorDefaultable { - case runtimeError, libraryError, reactError, unknownError, - invalidArgument, outOfBounds, invalidReactTag, nilValue; + // placeholder + case unspecified; }; diff --git a/ios/src_library/React Native/RNIError/RNIGenericErrorDefaultable+Default.swift b/ios/src_library/React Native/RNIError/RNIGenericErrorDefaultable+Default.swift new file mode 100644 index 00000000..6bc7ceea --- /dev/null +++ b/ios/src_library/React Native/RNIError/RNIGenericErrorDefaultable+Default.swift @@ -0,0 +1,42 @@ +// +// RNIGenericErrorDefaultable+Default.swift +// react-native-ios-modal +// +// Created by Dominic Go on 5/10/23. +// + +import Foundation + +public extension RNIGenericErrorDefaultable { + static var runtimeError: Self { + Self.runtimeError + }; + + static var libraryError: Self { + Self.libraryError + }; + + static var reactError: Self { + Self.reactError + }; + + static var unknownError: Self { + Self.unknownError + }; + + static var invalidArgument: Self { + Self.invalidArgument + }; + + static var outOfBounds: Self { + Self.outOfBounds + }; + + static var invalidReactTag: Self { + Self.invalidReactTag + }; + + static var nilValue: Self { + Self.nilValue + }; +};