another.im-ios/ConversationsClassic/AppData/Model/ServerFeature.swift
fmodf b3b3b3aef7 mv-experiment (#1)
Reviewed-on: narayana/conversations-classic-ios#1
Co-authored-by: fmodf <fmodf.ios@gmail.com>
Co-committed-by: fmodf <fmodf.ios@gmail.com>
2024-09-03 15:13:58 +00:00

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
}
}