Is there a way to programatically run OSX terminal commands from within an app.
For example, if I wanted to list all files in mac terminal I would use 'ls'. If I made an OSX app, is there a way I could run this command and then print out the result to the Xcode console?
I'm assuming this exists because it seems like something that should exist and with all the utilities on the App Store I'm sure some of them perform terminal commands.
Anyway, on short, how can I run terminal commands from an OSX app
Answers preferably in Swift but I can translate fairly well from Objective-C.
Thanks!