I am reading through the docs of swift and came across Type Methods. For example here: https://developer.apple.com/documentation/foundation/process
The offered Type Method is:
class func run(URL, arguments: [String], terminationHandler: ((Process) -> Void)? = nil)
How can I use this in my code? For example when I press a button? How can I add a clean-up function to the terminationHandler?