The favorites screen should present the all favorite posts. The home screen provides a favorites icon, but we haven't attached any functionality. This means that there are no favorite posts stored on Firebase. We will develop the favorites screen to render a list of all of the user's favorite posts. If the list of posts is empty, then the app will show a prompt to the user (not an empty screen) to suggest there are no favorite posts:
The UI has a collection view that can render all posts, similar to the one on the search screen. The more interesting part is the regular view, which contains a UIImageView and a UILable position in the middle. This view should be visible only when the collection is empty, to inform the user of the app.
The FavoritesViewController class is shown in the following code:
class FavoritesViewController: UIViewController {
...