From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Challenge: Favorites grid

Challenge: Favorites grid

- [Instructor Time for a double-header challenge. You're getting two challenges, one right after the other to handle two different issues in bringing menu grid view with a favorites grid to the app. In this first challenge, you'll have to make the favorites view with a five-column grid. When you double-tap a menu item in grid view, the item will disappear from the menu and appear in the favorites. On a long press on favorites, it will remove itself from favorites and go back to the menu. On both grids, you want to tap to select. To help you out, I'm giving you two files you'll find on the downloads under assets. So you'll find 'em here, and just drag in FavoriteCellView and Favorite.swift into your code, and copy files to destination. And we can take a look at them. We could start here with the FavoriteCellView, and you'll see that it's nothing really that special. It's pretty much just an image that we're getting from the menu item ID like we do right up here. And we're just checking…

Contents