swift close app

Swift
exit(0);
Source

Also in Swift: