Move extension methods to Swift.String, add tests

This commit is contained in:
ismailgulek
2022-05-30 16:05:00 +03:00
parent 23f9c6dbe2
commit 3a9240e7f7
3 changed files with 62 additions and 14 deletions
@@ -19,10 +19,6 @@ import MatrixSDK.MXLog
public extension NSString {
private enum Constants {
static let RTLOverrideChar: String = "\u{202E}"
}
/// Gets the first URL contained in the string ignoring any links to hosts defined in
/// the `firstURLDetectionIgnoredHosts` property of `MXKAppSettings`.
/// - Returns: A URL if detected, otherwise nil.
@@ -68,14 +64,4 @@ public extension NSString {
return detectedURL
}
/// Returns if the string contains an RTL override character
@objc func mxk_containsRTLOverride() -> Bool {
return contains(Constants.RTLOverrideChar)
}
/// Returns a new string which is reversed of the receiver
@objc func mxk_reversed() -> NSString {
return String((self as String).reversed()) as NSString
}
}