Simple Swift file for store and retrieve property lists.
Simply copy and paste AppDataPlist File on your Project :)
Data type should be in Codable. eg:-
import Foundation
struct User: Codable {
var name: String
var email: String
}
Use AppDataPlist.saveUserInformation(info: <#T##Decodable & Encodable#>, key: <#T##UserData.RawValue#>)
for save data. eg :-
let myUser = User(name: "Chathuranga",
email: "chathu@gmail.com")
AppDataPlist.saveUserInformation(info: myUser, key: UserData.userInfo.rawValue)
Use AppDataPlist.retrieveUserInformation(key: <#T##UserData.RawValue#>, type: <#T##(Decodable & Encodable).Protocol#>)
for retrieve data. eg :-
AppDataPlist.retrieveUserInformation(key: UserData.userInfo.rawValue, type: User.self)