仿通讯录列表演示
具体功能如下:
0.通讯录授权相关
1.创建通讯录联系人(我这里只创建了名字,其他的没写)
2.查询联系人(我这里只查询名字和头像,其他的注释掉了)
3.给没有头像的联系人显示一个默认头像(只是显示,并未更新到通讯录中)
4.多选,全选联系人列表
涉及到以下技术点有:
通讯录授权、通讯录访问、遍历联系人、创建联系人、为联系人创建索引
列表、列表多选、全选、列表索引、字符串首字母生成图片
导航栏、导航栏自定义
适配深色模式
Imitation address book list demo
The specific functions are as follows:
- Address book authorization related
- Create a contact in the address book (I only created the name here, but didn’t write the others)
- Query the contact person (I only query the name and avatar here, the others are commented out)
- Display a default avatar for contacts who do not have a avatar (only displayed, not updated in the address book)
- Multi-select, select all contacts list
The following technical points are involved:
CNContact authorization, CNContact access, traversing contacts, creating contacts, creating index for contacts
list, list multiple selection, select all, list index, string Generate pictures from the first letter
Navigation bar, navigation bar customization
Adapt to dark mode