Figure 8- 6 Add whitelist button at top left corner
Not bad, this is it. To customize the view like figure 8-6, we just need to find the controller
of “Mailboxes” view and then add the button by calling [controller.navigationItem
setLeftBarButtonItem:]. We have repeated the process of finding C from V for many times
previously and it has been proved as a feasible solution. After we know how to add the button,
we can try to implement the function of whitelist. It can be divided into three steps.
Get all emails.
Extract their senders’ addresses.
Mark them as read according to whitelist.
Let’s analyze them step by step, hope you can still catch up.
How can we get all emails? As we know, we can pull to refresh the inbox, as shown in figure
8-7.