How can I access `AnyHashable` types in `Any` in Swift?

后端 未结 1 586
盖世英雄少女心
盖世英雄少女心 2021-01-24 21:50

I\'m using APAddressBook to get the address book from the users phone. it generates the following object of users when I print the variable serializedContacts:

相关标签:
1条回答
  • 2021-01-24 22:37

    You should also convert the property you're trying to access to AnyHashable before. In your case this is:

    serializedContacts[0][AnyHashable("name")]
    
    0 讨论(0)
提交回复
热议问题