How to get a CNContact phone number(s) as string in Swift?

后端 未结 10 1793
执念已碎
执念已碎 2020-12-13 13:31

I am attempting to retrieve the names and phone number(s) of all contacts and put them into arrays with Swift in iOS. I have made it this far:



        
10条回答
  •  心在旅途
    2020-12-13 14:18

    I found the solution: (contact.phoneNumbers[0].value as! CNPhoneNumber).valueForKey("digits") as! String

提交回复
热议问题