mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
change applied and updated tests (#3751)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
extension String {
|
||||
/// Returns the string as an `AttributedString` with the specified character tinted in a different color.
|
||||
@@ -107,3 +108,13 @@ extension String {
|
||||
return "#\(aliasLocalPart):\(serverName)"
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
var validatedFileExtension: String {
|
||||
let fileExtension = (self as NSString).pathExtension
|
||||
guard !fileExtension.isEmpty else {
|
||||
return "bin"
|
||||
}
|
||||
return UTType(filenameExtension: fileExtension) != nil ? fileExtension : "bin"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user