How can I create an empty file in Swift code, preferably avoiding the Terminal, in as few lines of code as possible? I am using Swift 4, Xcode 9.4.1 and macOS High Sierra. I have tried using the Terminal to run Bash code, see my post here.
Edit:
The question this ones' been marked as duplicate for is for the terminal, which I am trying to avoid now, read that question (which I wrote) to see why.
Edit 2:
If the file already exists, I wish for the code to raise an error to the user, and the code will display it with NSTextField or UILabel.
Thanks in advance!