-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Port NSArray+MPCaseInsensitive to Swift
- Loading branch information
1 parent
7828fed
commit 270c050
Showing
6 changed files
with
34 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |