|
Hello, I am using the below code to filter the array contents. It works for a single property, in this case How to extend this functionality to cover the whole custom object? I feel like I need to write a custom method to cover everything, but cannot quite put my finger on it. Something like
What is the logic here? |
|
In HWS+. A suggestion for filtering list which give the break down how it made, and well worth it to subscribe as lots of great coding tips. For your make a swift file called FilteringList with this in
Then in replace List with
|
|
Or you can from WWDC Embrace Swift type inference Make a swift file called FilteringList with this in
then for the list
The first one give you more option fields to filter with but both will filter the list |
|
|
|
Hi Has anyone managed to make this work with a CoreData project where the list to be filtered is a coredata entity? I'm really struggling <doh!> Thanks |
|
@NigelGee, using the first approach, the selected list item remains selected after getting back to the list. Moreover, the detail view always redraws itself with animation (if tapped through a filtered list), otherwise loads directly without any kind of redrawing. I assume it tries to defilter itself? Any ideas? |
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.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.