Before finishing the iOS Foundations course from CodeWithChris, Chris invites us to upgrade / enhance module 5’s Recipe List app with an additional “categories” filter.
This involves adding a new “tab” to the TabView
to show the ‘Categories’ button, and a new view that combines the GeometryReader
, ScrollView
, LazyVGrid
(a new one on us!), ForEach
, Button
, and a computed property to determine which category should be displayed when one is selected.
Not only that, he also introduces us to Set()
which can be used to assist with filtering a list of elements so that only unique elements are returned (automatically removing any duplicates) – although this does require us to use Array(...)
to change the Set()
into a proper array if we wish to loop through it with ForEach
.