Gentlemen, who is well versed in the swift language? I need to access one or more files in the Assets.xcassets folder from the program. How can this be done and is it possible in principle?
1 answer
func readBundle(file:String) -> String { var res = "" if let asset = NSDataAsset(name: file) , string = String(data:asset.data, encoding: NSUTF8StringEncoding) { res = string } return res } The answer is taken here .
|