Decode PropertyList using Swift 4 Codable PropertyListDecoder()
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Im trying to decode a plist using PropertyListDecoder() but when I get to the trying to access the keys, I get an error that says it's in the wrong format. I'm at a loss on what I'm doing wrong. Im under the assumption I can decode a Plist file the same way I can decode a JSON file right? I don't know, I'm still new to this. //struct for PLists struct AccessControl: Decodable { enum AccessControlKeys: String, CodingKey { case api } enum KeySecretKeys: String, CodingKey { case apiKey = "KEY" case apiSecret = "SECRET" } var KEYS: [KeySecrets]