Skip to content

Instantly share code, notes, and snippets.

@adsl99801
Last active March 21, 2018 02:32
Show Gist options
  • Save adsl99801/061d789d42e1382f87e5728db36a126e to your computer and use it in GitHub Desktop.
Save adsl99801/061d789d42e1382f87e5728db36a126e to your computer and use it in GitHub Desktop.
IOS Objectivec
NSString* fontName = [[AppDelegate getSetting] fontName];
int fontSize = [[AppDelegate getSetting] fontSize];
@adsl99801
Copy link
Author

adsl99801 commented Jan 30, 2018

import Foundation
class FileTool{
    public func dir() -> URL {
        return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
    }
    public func documentsDir() -> String {
        
        var paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true) as [String]
        return paths[0]
    }
    
    public func cachesDir() -> String {
        var paths = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true) as [String]
        return paths[0]
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment