Today was the conclusion of Project 7. We started off creating the project in Xcode and establishing a table view controller. We connected a navigation controller to the table view controller. We finally added a view controller for the individual petitions. In Part 2 we created a viewport to display the individual petitions and added a tab bar controller to allow users to select the type of petitions they wanted to see.
Today we are concluding the project. In this section we began extending our knowledge by manipulating the JSON file making additional calls to WeThePeople to pull various data. This gave us more experience understanding how JSON worked and the power it provided.
The wrap up challenge was to add additional searches. In my case I created links in the tab bar for “Most Recent”, “Top Rated”, “Closed”, and “Open” to allow the user to get different views of the petitions being created.
The second part of the challenge was to add a button to the navigation bar that when clicked will create a dialog box telling the user that the data came from “We the People”. This was relatively straight forward. We have been doing alert boxes in many of the recent projects so this simply meant placing a button in the navigation controller that when clicked would call the UIAlertController displaying the message.
The final challenge was to allow the users to filter the petitions with some sort of text string. For this I created another UI Bar Button called Filter that when clicked would display an alert with a text field. When the user entered text, it would then create an array of petitions that contained the filter criteria and show only those in the table view controller. That was a little more involved but was really fun to work on.
Overall this was a great project that really stretched our skills. We learned to parse JSON, display web content in a view controller, create a tab bar controller and populate it, and adjust contents displayed based upon a user supplied filter. Each of these projects are becoming more difficult. Although they can be challenging and sometimes overwhelming, they are not impossible. Whenever I start to get stressed that this might be more than what I am capable of doing I remind myself of the first rule of scuba diving: “1. Don’t forget to breathe.” Anything beyond that will take care of itself.
0 Comments