22 lines
565 B
Swift
22 lines
565 B
Swift
|
import Foundation
|
||
|
|
||
|
struct ServerFeature: Identifiable & Codable {
|
||
|
let xep: String
|
||
|
let name: String
|
||
|
let xmppId: String?
|
||
|
let description: String?
|
||
|
|
||
|
var id: String { xep }
|
||
|
|
||
|
static var allFeatures: [ServerFeature] {
|
||
|
guard
|
||
|
let url = Bundle.main.url(forResource: "server_features", withExtension: "plist"),
|
||
|
let data = try? Data(contentsOf: url),
|
||
|
let loaded = try? PropertyListDecoder().decode([ServerFeature].self, from: data)
|
||
|
else {
|
||
|
return []
|
||
|
}
|
||
|
return loaded
|
||
|
}
|
||
|
}
|