This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Property List file name = regions.plist | |
let pListFileURL = Bundle.main.url(forResource: "regions", withExtension: "plist", subdirectory: "") | |
if let pListPath = pListFileURL?.path, | |
let pListData = FileManager.default.contents(atPath: pListPath) { | |
do { | |
let pListObject = try PropertyListSerialization.propertyList(from: pListData, options:PropertyListSerialization.ReadOptions(), format:nil) | |
//Cast pListObject - If expected data type is Dictionary | |
guard let pListDict = pListObject as? Dictionary<String, AnyObject> else { | |
return | |
} |