Skip to content

Instantly share code, notes, and snippets.

View iGranDav's full-sized avatar
🤘
let's make it possible

David Bonnet iGranDav

🤘
let's make it possible
View GitHub Profile
import Foundation
extension UIDevice {
/**
Try to get the username from the device name using common knows
default device names format.
- copyright: Owen Godfrey on [StackOverflow](http://stackoverflow.com/questions/8261961/better-way-to-get-the-users-name-from-device)
- remark: Original regexpr improved to support custom name with model included eg. `<username>'s iPhone 6S`