title: Find User Name or First/Last Name in iOS9 CloudKit / ABPerson (ABAddressBook)
body: <p>iOS9 deprecates user info features <a href="https://developer.apple.com/library/prerelease/ios/documentation/CloudKit/Reference/CKDiscoveredUserInfo_class/index.html#//apple_ref/occ/instp/CKDiscoveredUserInfo/firstName" rel="nofollow">for CloudKit</a> and <a href="https://developer.apple.com/library/prerelease/ios/documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/index.html" rel="nofollow">ABPerson</a>.</p>
  
  <p>e.g. in the properties of CKDiscoveredUserInfo</p>
  
  <blockquote>
    <p>firstName" Deprecated in iOS 9.0 </p>
    
    <p>lastName" Deprecated in iOS 9.0</p>
  </blockquote>
  
  <p>I want last name and first name as previously provided in iOS8 CloudKit.</p>
  
  <p>How to retrieve the similar information in iOS9 CloudKit, ABPerson or something else?</p>
  
  <p><a href="http://iosdevelopertips.com/core-services/getting-the-iphone-user-name.html" rel="nofollow">Short of grace method is this</a></p>
  
  <pre><code>[[UIDevice currentDevice] name]; 
  
   NSArray *nameArray = [[NSHost currentHost] names];
   NSString *user = [nameArray objectAtIndex:0];
  </code></pre>
  
  <p>Both print e.g. John'iPhone. </p>