Created
January 9, 2016 22:00
-
-
Save ericdke/29f94d9235d2e3514ae2 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
| func getHostName(completion:(name:String)->()) { | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { | |
| if let name = NSHost.currentHost().localizedName { | |
| completion(name: name) | |
| } | |
| } | |
| } | |
| getHostName { name in | |
| print(name) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment