mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
real
This commit is contained in:
@@ -2,10 +2,17 @@ import Foundation
|
||||
import NaturalLanguage
|
||||
|
||||
extension String {
|
||||
|
||||
static func ~= (lhs: String, rhs: String) -> Bool {
|
||||
lhs.firstMatch(rhs) != nil
|
||||
}
|
||||
|
||||
var localized: String {
|
||||
BundleHelper.shared.localizedString(self)
|
||||
}
|
||||
|
||||
func localizeWithFormat(_ arguments: CVarArg...) -> String{
|
||||
String(format: self.localized, arguments: arguments)
|
||||
}
|
||||
|
||||
var range: NSRange {
|
||||
NSRange(self.startIndex..., in: self)
|
||||
|
||||
@@ -88,7 +88,7 @@ extension UserDefaults {
|
||||
static var patchType: PatchType {
|
||||
get {
|
||||
if let rawValue = defaults.object(forKey: patchTypeKey) as? Int {
|
||||
return PatchType(rawValue: rawValue)!
|
||||
return PatchType(rawValue: rawValue) ?? .requests
|
||||
}
|
||||
|
||||
return .notSet
|
||||
|
||||
Reference in New Issue
Block a user