Member-only story

How To Section Lists Alphabetically in SwiftUI

How to group, search, and filter through your contact list

Sarah
Better Programming
2 min readFeb 9, 2021

--

Searching through contact list

Contact

Create an identifiable struct for our contacts that stores the first name, last name, and phone number. Add an ID of type UUID to conform to the Identifiable protocol.

To fetch your phone’s contact list, you will need to follow the steps in the article below:

Search Bar

To create a search bar, we need to horizontally stack an image of a magnifying glass, TextField, X button, and a cancel button. The cancel button will be visible when the user begins editing the TextField.

Check this answer on Stack Overflow for reference.

--

--

Responses (2)

What are your thoughts?