Getting Username in Swift

I created an osx application and want to display the username in my ui. How can I get the username for the actual user / maybe?

+5
source share
1 answer

You can use the NSUserName() function:

 var username = NSUserName()! 
+12
source

Source: https://habr.com/ru/post/1203426/


All Articles