Reputation: 948
The Apple documentation talks about the Swift class FileManager
, but Xcode is not recognizing it as part of Foundation, I get the error below. Where is this class then?
It says Use of unresolved identifier 'FileManager'
.
I thought this was a new API that would replace NSFileManager.
Btw, the app documentation that talks about it is here: FileManager class
Upvotes: 2
Views: 4723
Reputation: 2332
You need to "import Foundation" before using the FileManager class.
import Foundation
let fileManager = FileManager()
Upvotes: 7
Reputation: 1112
I think it's NSFileManager()
let fileManager = NSFileManager.defaultManager()
Upvotes: 0