JavaNut13 JavaNut13 - 1 month ago 5
Swift Question

Create Folder in Swift

I'm new to swift and I'm not sure how to make a new folder from a string path (or from some kind of

File/ NSFile

This is on OS X with Cocoa.


My understanding is that you are trying to create a directory programmatically using swift. The code given below does the same.

    var err: NSErrorPointer = nil
    let manager = NSFileManager.defaultManager()
    manager.createDirectoryAtPath("/Users/abc/Desktop/swiftDir", withIntermediateDirectories: true, attributes: nil, error: err)