Forked from tonyarnold/NSFileManagerAdditions.swift
Last active
August 29, 2015 14:02
-
-
Save scelis/d8417e77269a54083273 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// Copyright (c) 2014 Tony Arnold & The CocoaBots. All rights reserved. | |
import Foundation | |
extension NSFileManager | |
{ | |
class func applicationSupportDirectoryURL() -> NSURL? | |
{ | |
if let directories = self.defaultManager().URLsForDirectory(NSSearchPathDirectory.ApplicationSupportDirectory, inDomains: NSSearchPathDomainMask.UserDomainMask) as? Array<NSURL> | |
{ | |
if (directories.count > 0) | |
{ | |
return directories[0] | |
} | |
} | |
return nil | |
} | |
} |
This file contains hidden or 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
// | |
// Copyright (c) 2014 Tony Arnold & The CocoaBots. All rights reserved. | |
import XCTest | |
import SwiftlyCoreData | |
class NSFileManagerAdditions: XCTestCase | |
{ | |
func testApplicationSupportDirectoryURLWorks() | |
{ | |
let appSupport = NSFileManager.applicationSupportDirectoryURL() | |
XCTAssertNotNil(appSupport, "Should not be nil") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment