显示当前用户的用户名 (Swift)
问题描述:
是否可以在 macOS 应用中显示当前用户的用户名?
Is it possible to display the username of the current user in a macOS app?
答
Swift 4.2
let userName = NSUserName()
let fullUserName = NSFullUserName()