Created
June 23, 2015 14:00
-
-
Save wtsnz/a47709427c45c925535b 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
extension UIDevice { | |
/** | |
Returns the name of the current devices' owner, maybe. | |
Usually iPhones are named something like "Will's iPhone", or "Will's iPad", this method is a simple, unreliable way of getting the persons name from that string. | |
:returns: Optional string that might be the owners name. | |
*/ | |
func ownersName() -> String? { | |
return UIDevice.currentDevice().name.componentsSeparatedByString("'").first | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well done.