File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Shared/Samples/Animate 3D graphic Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -276,11 +276,9 @@ extension Animate3DGraphicView {
276276 /// Loads the frames of a mission from a CSV file.
277277 /// - Parameter filename: The name of the file containing the CSV data.
278278 mutating func loadFrames( for filename: String ) {
279- // Get the path of the file from the bundle using the filename name.
280- guard let path = Bundle . main. path ( forResource: filename, ofType: " csv " ) else { return }
281-
282- // Get the content of the file using the path.
283- guard let content = try ? String ( contentsOfFile: path) else { return }
279+ // Get the content of the file from the bundle using the filename name.
280+ guard let path = Bundle . main. url ( forResource: filename, withExtension: " csv " ) ,
281+ let content = try ? String ( contentsOf: path, encoding: . utf8) else { return }
284282
285283 // Split the content by line into an array.
286284 let lines = content. split ( whereSeparator: \. isNewline)
You can’t perform that action at this time.
0 commit comments