iosswiftaddressbookui

Requesting data about user iOS


Is there an API in iOS which would allow me to discover information about the user who owns the phone?

The address book api would allow me access to their contacts, but how would I find out about the self user?

Thanks!


Solution

  • You could go through all the contacts in the Address Book and see if any of them are marked with the owner flag.
    Edit
    This was removed a while back, another way is getting the device name UIDevice.currentDevice().name
    "Bob's Iphone"
    Then you could cylce through the address book and find a bob, this is a solution i wouldn't recommend, the best bet might be to ask the user for their details