UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Creating a dropdown searchable list in SwiftUI?

Forums > SwiftUI

Hey guys,

I have to create a search experience that looks something like this but in SwiftUI. I already have a custom search bar and the search results. How can I begin approaching this? If you need any code please let me know!



The thing is that searchable only works on Apple's own search bar, right? I have a custom search bar, is there anyway to use searchable with a custom search bar, or at least modify the search bar appearance?


As well, doesn't the search suggestions only work for predetermined searches? I want it to be like the Amazon app for example, where when you type the suggestions are filtered dynamically and presented in a dropdown list.


The article inlcludes this part ->

You can update the suggestions that you provide as conditions change. For example, you can specify an array of suggestedSearches that you store in your app’s model.

As for custom searchbar, I assume the whole lot of code needs to be added for such feature.


Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.