Created
October 9, 2018 15:08
-
-
Save dklenke/64345cad2b853dd321d35b997dacea61 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
let fileMang = FileManager.default | |
var filePath = NSHomeDirectory() | |
do { | |
let appSupportDir = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) | |
filePath = appSupportDir.appendingPathComponent("points.txt").path | |
} | |
catch{} | |
print(filePath) | |
if fileMang.fileExists(atPath: filePath) { | |
do { | |
try fileMang.removeItem(atPath: filePath) | |
} | |
catch {} | |
} | |
let test = fileMang.createFile(atPath: filePath, contents: "0, 0, 0".data(using: String.Encoding.utf8), attributes: nil) | |
print(test) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment