From 270c0505d0599dd3ab18cf3fdf2db011b07b98af Mon Sep 17 00:00:00 2001 From: Brandon Stalnaker Date: Mon, 7 Oct 2024 15:37:07 -0400 Subject: [PATCH] refactor: Port NSArray+MPCaseInsensitive to Swift --- mParticle-Apple-SDK.xcodeproj/project.pbxproj | 24 +++++++----------- .../Include/NSArray+MPCaseInsensitive.h | 7 ------ mParticle-Apple-SDK/Include/mParticle.h | 1 - mParticle-Apple-SDK/Kits/MPKitContainer.mm | 1 - .../Utils/NSArray+MPCaseInsensitive.m | 19 -------------- .../Utils/NSArray+MPCaseInsensitive.swift | 25 +++++++++++++++++++ 6 files changed, 34 insertions(+), 43 deletions(-) delete mode 100644 mParticle-Apple-SDK/Include/NSArray+MPCaseInsensitive.h delete mode 100644 mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.m create mode 100644 mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.swift diff --git a/mParticle-Apple-SDK.xcodeproj/project.pbxproj b/mParticle-Apple-SDK.xcodeproj/project.pbxproj index 94aaf9b64..18bd8bd5f 100644 --- a/mParticle-Apple-SDK.xcodeproj/project.pbxproj +++ b/mParticle-Apple-SDK.xcodeproj/project.pbxproj @@ -150,7 +150,6 @@ 53A79BC929CDFB2000E7489F /* MPIUserDefaults.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79B0429CDFB1F00E7489F /* MPIUserDefaults.h */; }; 53A79BCA29CDFB2000E7489F /* MPConvertJS.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B0529CDFB1F00E7489F /* MPConvertJS.m */; }; 53A79BCB29CDFB2000E7489F /* MPStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79B0629CDFB1F00E7489F /* MPStateMachine.h */; }; - 53A79BCC29CDFB2000E7489F /* NSArray+MPCaseInsensitive.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B0729CDFB1F00E7489F /* NSArray+MPCaseInsensitive.m */; }; 53A79BCE29CDFB2000E7489F /* NSDictionary+MPCaseInsensitive.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B0929CDFB1F00E7489F /* NSDictionary+MPCaseInsensitive.m */; }; 53A79BCF29CDFB2000E7489F /* MPResponseEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B0A29CDFB1F00E7489F /* MPResponseEvents.m */; }; 53A79BD129CDFB2000E7489F /* MPResponseConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79B0C29CDFB1F00E7489F /* MPResponseConfig.h */; }; @@ -245,7 +244,6 @@ 53A79C5329CDFB4800E7489F /* MPIdentityApi.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3129CDFB4800E7489F /* MPIdentityApi.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79C5529CDFB4800E7489F /* NSDictionary+MPCaseInsensitive.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3329CDFB4800E7489F /* NSDictionary+MPCaseInsensitive.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79C5629CDFB4800E7489F /* MParticleUser.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3429CDFB4800E7489F /* MParticleUser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 53A79C5729CDFB4800E7489F /* NSArray+MPCaseInsensitive.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3529CDFB4800E7489F /* NSArray+MPCaseInsensitive.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79C5829CDFB4800E7489F /* MPCommerceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3629CDFB4800E7489F /* MPCommerceEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79C5929CDFB4800E7489F /* MPAliasResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3729CDFB4800E7489F /* MPAliasResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79C5B29CDFB4800E7489F /* MPIdentityApiRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3929CDFB4800E7489F /* MPIdentityApiRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -335,7 +333,6 @@ 53A79D0B29CE23F700E7489F /* MPProduct.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C4329CDFB4800E7489F /* MPProduct.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79D0C29CE23F700E7489F /* MPExtensionProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C2829CDFB4800E7489F /* MPExtensionProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79D0D29CE23F700E7489F /* MPIdentityApiRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3929CDFB4800E7489F /* MPIdentityApiRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 53A79D0E29CE23F700E7489F /* NSArray+MPCaseInsensitive.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3529CDFB4800E7489F /* NSArray+MPCaseInsensitive.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79D0F29CE23F700E7489F /* MPForwardRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C2529CDFB4800E7489F /* MPForwardRecord.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79D1029CE23F700E7489F /* FilteredMParticleUser.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C2929CDFB4800E7489F /* FilteredMParticleUser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53A79D1129CE23F700E7489F /* MPCommerceEvent+Dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A79C3F29CDFB4800E7489F /* MPCommerceEvent+Dictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -442,7 +439,6 @@ 53A79D8229CE23F700E7489F /* MPCommerceEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B4029CDFB1F00E7489F /* MPCommerceEvent.mm */; }; 53A79D8329CE23F700E7489F /* MPConsentSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79AF729CDFB1F00E7489F /* MPConsentSerialization.m */; }; 53A79D8429CE23F700E7489F /* MPIdentityApi.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79AA129CDFB1E00E7489F /* MPIdentityApi.m */; }; - 53A79D8529CE23F700E7489F /* NSArray+MPCaseInsensitive.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B0729CDFB1F00E7489F /* NSArray+MPCaseInsensitive.m */; }; 53A79D8629CE23F700E7489F /* MPUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79AC929CDFB1E00E7489F /* MPUpload.m */; }; 53A79D8729CE23F700E7489F /* MPAppDelegateProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B3B29CDFB1F00E7489F /* MPAppDelegateProxy.m */; }; 53A79D8829CE23F700E7489F /* MPApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A79B0D29CDFB1F00E7489F /* MPApplication.m */; }; @@ -502,6 +498,8 @@ 53FDD1BD2AE871AF003D5FA1 /* MPIHasher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FDD1BC2AE871AF003D5FA1 /* MPIHasher.swift */; }; 53FDD1BE2AE871AF003D5FA1 /* MPIHasher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FDD1BC2AE871AF003D5FA1 /* MPIHasher.swift */; }; D3724C192AE02AF60074CD67 /* mParticle_Apple_SDK_NoLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = D3724C182AE02AF60074CD67 /* mParticle_Apple_SDK_NoLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D3961CD62CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3961CD52CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift */; }; + D3961CD72CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3961CD52CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift */; }; D3B3E2072AE029AE001AB58C /* mParticle_Apple_SDK.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B3E2062AE028EC001AB58C /* mParticle_Apple_SDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; D3CEDAB92C9B14BF001B32DF /* MPCCPAConsent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAB82C9B14BF001B32DF /* MPCCPAConsent.swift */; }; D3CEDABA2C9B14BF001B32DF /* MPCCPAConsent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAB82C9B14BF001B32DF /* MPCCPAConsent.swift */; }; @@ -511,12 +509,12 @@ D3CEDABF2C9C5B5B001B32DF /* MPGDPRConsent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDABD2C9C5B5B001B32DF /* MPGDPRConsent.swift */; }; D3CEDAC02C9C5B5B001B32DF /* MPGDPRConsent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDABD2C9C5B5B001B32DF /* MPGDPRConsent.swift */; }; D3CEDAC12C9C5B5B001B32DF /* MPGDPRConsent.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDABD2C9C5B5B001B32DF /* MPGDPRConsent.swift */; }; - D3CEDAC82CA2F214001B32DF /* MPLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC72CA2F214001B32DF /* MPLogger.swift */; }; - D3CEDAC92CA2F214001B32DF /* MPLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC72CA2F214001B32DF /* MPLogger.swift */; }; D3CEDAC32C9DAC25001B32DF /* MPDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC22C9DAC25001B32DF /* MPDateFormatter.swift */; }; D3CEDAC42C9DB0E0001B32DF /* MPDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC22C9DAC25001B32DF /* MPDateFormatter.swift */; }; D3CEDAC52C9DB0E0001B32DF /* MPDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC22C9DAC25001B32DF /* MPDateFormatter.swift */; }; D3CEDAC62C9DB0E1001B32DF /* MPDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC22C9DAC25001B32DF /* MPDateFormatter.swift */; }; + D3CEDAC82CA2F214001B32DF /* MPLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC72CA2F214001B32DF /* MPLogger.swift */; }; + D3CEDAC92CA2F214001B32DF /* MPLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3CEDAC72CA2F214001B32DF /* MPLogger.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -609,7 +607,6 @@ 53A79B0429CDFB1F00E7489F /* MPIUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPIUserDefaults.h; sourceTree = ""; }; 53A79B0529CDFB1F00E7489F /* MPConvertJS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPConvertJS.m; sourceTree = ""; }; 53A79B0629CDFB1F00E7489F /* MPStateMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPStateMachine.h; sourceTree = ""; }; - 53A79B0729CDFB1F00E7489F /* NSArray+MPCaseInsensitive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+MPCaseInsensitive.m"; sourceTree = ""; }; 53A79B0929CDFB1F00E7489F /* NSDictionary+MPCaseInsensitive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+MPCaseInsensitive.m"; sourceTree = ""; }; 53A79B0A29CDFB1F00E7489F /* MPResponseEvents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPResponseEvents.m; sourceTree = ""; }; 53A79B0C29CDFB1F00E7489F /* MPResponseConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPResponseConfig.h; sourceTree = ""; }; @@ -704,7 +701,6 @@ 53A79C3129CDFB4800E7489F /* MPIdentityApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPIdentityApi.h; sourceTree = ""; }; 53A79C3329CDFB4800E7489F /* NSDictionary+MPCaseInsensitive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+MPCaseInsensitive.h"; sourceTree = ""; }; 53A79C3429CDFB4800E7489F /* MParticleUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MParticleUser.h; sourceTree = ""; }; - 53A79C3529CDFB4800E7489F /* NSArray+MPCaseInsensitive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MPCaseInsensitive.h"; sourceTree = ""; }; 53A79C3629CDFB4800E7489F /* MPCommerceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCommerceEvent.h; sourceTree = ""; }; 53A79C3729CDFB4800E7489F /* MPAliasResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAliasResponse.h; sourceTree = ""; }; 53A79C3929CDFB4800E7489F /* MPIdentityApiRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPIdentityApiRequest.h; sourceTree = ""; }; @@ -800,12 +796,13 @@ 53B33E892A4606CD00CC8A19 /* MPSideloadedKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSideloadedKit.swift; sourceTree = ""; }; 53FDD1BC2AE871AF003D5FA1 /* MPIHasher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPIHasher.swift; sourceTree = ""; }; D3724C182AE02AF60074CD67 /* mParticle_Apple_SDK_NoLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mParticle_Apple_SDK_NoLocation.h; sourceTree = ""; }; + D3961CD52CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSArray+MPCaseInsensitive.swift"; sourceTree = ""; }; D3B3E2062AE028EC001AB58C /* mParticle_Apple_SDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mParticle_Apple_SDK.h; sourceTree = ""; }; D3BA75152B614E3D008C3C65 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; D3CEDAB82C9B14BF001B32DF /* MPCCPAConsent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPCCPAConsent.swift; sourceTree = ""; }; D3CEDABD2C9C5B5B001B32DF /* MPGDPRConsent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPGDPRConsent.swift; sourceTree = ""; }; - D3CEDAC72CA2F214001B32DF /* MPLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPLogger.swift; sourceTree = ""; }; D3CEDAC22C9DAC25001B32DF /* MPDateFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDateFormatter.swift; sourceTree = ""; }; + D3CEDAC72CA2F214001B32DF /* MPLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPLogger.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1023,11 +1020,11 @@ children = ( 5399DDB72CA727E1006526E1 /* MPZip.swift */, 53A79B0229CDFB1F00E7489F /* MPMessageBuilder.m */, + D3961CD52CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift */, 53A79B0329CDFB1F00E7489F /* MPStateMachine.m */, 53A79B0429CDFB1F00E7489F /* MPIUserDefaults.h */, 53A79B0529CDFB1F00E7489F /* MPConvertJS.m */, 53A79B0629CDFB1F00E7489F /* MPStateMachine.h */, - 53A79B0729CDFB1F00E7489F /* NSArray+MPCaseInsensitive.m */, 53A79B0929CDFB1F00E7489F /* NSDictionary+MPCaseInsensitive.m */, 53A79B0A29CDFB1F00E7489F /* MPResponseEvents.m */, 53A79B0C29CDFB1F00E7489F /* MPResponseConfig.h */, @@ -1189,7 +1186,6 @@ 53A79C3129CDFB4800E7489F /* MPIdentityApi.h */, 53A79C3329CDFB4800E7489F /* NSDictionary+MPCaseInsensitive.h */, 53A79C3429CDFB4800E7489F /* MParticleUser.h */, - 53A79C3529CDFB4800E7489F /* NSArray+MPCaseInsensitive.h */, 53A79C3629CDFB4800E7489F /* MPCommerceEvent.h */, 53A79C3729CDFB4800E7489F /* MPAliasResponse.h */, 53A79C3929CDFB4800E7489F /* MPIdentityApiRequest.h */, @@ -1332,7 +1328,6 @@ 53A79C6529CDFB4800E7489F /* MPProduct.h in Headers */, 53A79C4A29CDFB4800E7489F /* MPExtensionProtocol.h in Headers */, 53A79C5B29CDFB4800E7489F /* MPIdentityApiRequest.h in Headers */, - 53A79C5729CDFB4800E7489F /* NSArray+MPCaseInsensitive.h in Headers */, 53A79C4729CDFB4800E7489F /* MPForwardRecord.h in Headers */, 53A79C4B29CDFB4800E7489F /* FilteredMParticleUser.h in Headers */, 53A79C6129CDFB4800E7489F /* MPCommerceEvent+Dictionary.h in Headers */, @@ -1434,7 +1429,6 @@ 53A79D0B29CE23F700E7489F /* MPProduct.h in Headers */, 53A79D0C29CE23F700E7489F /* MPExtensionProtocol.h in Headers */, 53A79D0D29CE23F700E7489F /* MPIdentityApiRequest.h in Headers */, - 53A79D0E29CE23F700E7489F /* NSArray+MPCaseInsensitive.h in Headers */, 53A79D0F29CE23F700E7489F /* MPForwardRecord.h in Headers */, 53A79D1029CE23F700E7489F /* FilteredMParticleUser.h in Headers */, 53A79D1129CE23F700E7489F /* MPCommerceEvent+Dictionary.h in Headers */, @@ -1761,6 +1755,7 @@ 53A79BEB29CDFB2000E7489F /* NSNumber+MPFormatter.swift in Sources */, 53A79B6D29CDFB2000E7489F /* FilteredMParticleUser.m in Sources */, 53A79C0729CDFB2100E7489F /* MPBaseEvent.m in Sources */, + D3961CD62CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift in Sources */, 53A79C1829CDFB2100E7489F /* MPAttributeProjection.m in Sources */, 53A79B8E29CDFB2000E7489F /* MPConsumerInfo.m in Sources */, 53A79C0D29CDFB2100E7489F /* MPKitConfiguration.mm in Sources */, @@ -1776,7 +1771,6 @@ 53A79C0129CDFB2100E7489F /* MPCommerceEvent.mm in Sources */, 53A79BBF29CDFB2000E7489F /* MPConsentSerialization.m in Sources */, 53A79B6F29CDFB2000E7489F /* MPIdentityApi.m in Sources */, - 53A79BCC29CDFB2000E7489F /* NSArray+MPCaseInsensitive.m in Sources */, 53A79B9329CDFB2000E7489F /* MPUpload.m in Sources */, 53A79BFD29CDFB2100E7489F /* MPAppDelegateProxy.m in Sources */, D3CEDAB92C9B14BF001B32DF /* MPCCPAConsent.swift in Sources */, @@ -1930,6 +1924,7 @@ 53A79D7329CE23F700E7489F /* FilteredMParticleUser.m in Sources */, 53A79D7429CE23F700E7489F /* MPBaseEvent.m in Sources */, 53A79D7529CE23F700E7489F /* MPAttributeProjection.m in Sources */, + D3961CD72CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift in Sources */, 53A79D7629CE23F700E7489F /* MPConsumerInfo.m in Sources */, 53A79D7729CE23F700E7489F /* MPKitConfiguration.mm in Sources */, 53A79D7829CE23F700E7489F /* MPConsentState.m in Sources */, @@ -1945,7 +1940,6 @@ 53A79D8229CE23F700E7489F /* MPCommerceEvent.mm in Sources */, 53A79D8329CE23F700E7489F /* MPConsentSerialization.m in Sources */, 53A79D8429CE23F700E7489F /* MPIdentityApi.m in Sources */, - 53A79D8529CE23F700E7489F /* NSArray+MPCaseInsensitive.m in Sources */, 53A79D8629CE23F700E7489F /* MPUpload.m in Sources */, 53A79D8729CE23F700E7489F /* MPAppDelegateProxy.m in Sources */, D3CEDABA2C9B14BF001B32DF /* MPCCPAConsent.swift in Sources */, diff --git a/mParticle-Apple-SDK/Include/NSArray+MPCaseInsensitive.h b/mParticle-Apple-SDK/Include/NSArray+MPCaseInsensitive.h deleted file mode 100644 index cabf32524..000000000 --- a/mParticle-Apple-SDK/Include/NSArray+MPCaseInsensitive.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface NSArray (MPCaseInsensitive) - -- (BOOL)caseInsensitiveContainsObject:(nonnull NSString *)object; - -@end diff --git a/mParticle-Apple-SDK/Include/mParticle.h b/mParticle-Apple-SDK/Include/mParticle.h index dd804dce2..9508a36bd 100644 --- a/mParticle-Apple-SDK/Include/mParticle.h +++ b/mParticle-Apple-SDK/Include/mParticle.h @@ -12,7 +12,6 @@ #import "MPPromotion.h" #import "MPTransactionAttributes.h" #import "MPTransactionAttributes+Dictionary.h" -#import "NSArray+MPCaseInsensitive.h" #import "NSDictionary+MPCaseInsensitive.h" #import "MPIdentityApi.h" #import "MPKitAPI.h" diff --git a/mParticle-Apple-SDK/Kits/MPKitContainer.mm b/mParticle-Apple-SDK/Kits/MPKitContainer.mm index 6053e09cc..f1b512faa 100644 --- a/mParticle-Apple-SDK/Kits/MPKitContainer.mm +++ b/mParticle-Apple-SDK/Kits/MPKitContainer.mm @@ -19,7 +19,6 @@ #import "MPProduct.h" #import "MPProduct+Dictionary.h" #import "NSDictionary+MPCaseInsensitive.h" -#import "NSArray+MPCaseInsensitive.h" #import "MPIUserDefaults.h" #import "MPConsumerInfo.h" #import "MPForwardQueueItem.h" diff --git a/mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.m b/mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.m deleted file mode 100644 index 5349bf512..000000000 --- a/mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.m +++ /dev/null @@ -1,19 +0,0 @@ -#import "NSArray+MPCaseInsensitive.h" - -@implementation NSArray (MPCaseInsensitive) - -- (BOOL)caseInsensitiveContainsObject:(nonnull NSString *)object { - __block BOOL result = NO; - Class NSStringClass = [NSString class]; - [self enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - if ([obj isKindOfClass:NSStringClass]) { - if ([object caseInsensitiveCompare:obj] == NSOrderedSame) { - result = YES; - *stop = YES; - } - } - }]; - return result; -} - -@end diff --git a/mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.swift b/mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.swift new file mode 100644 index 000000000..4a6cb65a5 --- /dev/null +++ b/mParticle-Apple-SDK/Utils/NSArray+MPCaseInsensitive.swift @@ -0,0 +1,25 @@ +// +// NSArray+MPCaseInsensitive.swift +// mParticle-Apple-SDK +// +// Created by Brandon Stalnaker on 10/7/24. +// + +import Foundation + +extension NSArray { + + @objc public func caseInsensitiveContainsObject(_ object: String) -> Bool { + var result = false + self.forEach {obj in + if let stringObj = obj as? String { + if (stringObj.caseInsensitiveCompare(object) == ComparisonResult.orderedSame) { + result = true + return + } + } + } + + return result; + } +}