![]() ![]() Replace the view in the preview code with: FilterView(selectedSports. For example, a user who only wants to see basketball can filter out all other games.įirst, create a new SwiftUI file named FilterView.swift, and add the following properties to the generated struct: var selectedSports: Setīefore moving on, you’ll fix the preview code so your code compiles. To make it more user-friendly, you’ll implement a filtering functionality. ![]() In the first iteration of the events screen, the navigation is somewhat cumbersome: the only way to find an event is to scroll to it, which can take a while. Head over to the already familiar ContentView.swift. If you’re starting from the starter project, these files and values will already be part of your project. Since you’ll work on several different components this time, append the following values inside your Constants enum, over at Constants.swift: static let spacingS = 8.0 To pick up where you left off at the previous chapter, grab the EventDetails folder and the Asset catalog, Assets.xcassets, from this chapter’s starter project and add them to your current project. You can continue working on the project from the previous chapter or use the starter project from this chapter’s materials. You’ll also get to roll up your sleeves and craft a custom transition. Since this is an animations book, you’ll also enhance them via various types of transitions, which you already got to briefly play with in the first chapter. You’ll implement popular UI concepts like list filters, a collapsing header view and floating action buttons. In this chapter, you’ll work on a new screen that contains a game’s details as the next step toward the ticket purchase. You managed to improve its pull-to-refresh animation, turning the system loading wheel into a fun and memorable interaction. In the previous chapter, you started working on a sports-themed app to sell game tickets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |