Tuesday, October 13th — 11:59pm
This project is designed to give you some hands on experience with…
- Using Xcode as a development environment
- Using Interface Builder to create iPhone user interfaces
- Declaring and wiring outlets and actions
- Testing applications in the iPhone Simulator
- Exposure to additional table views and navigation-based apps
- Using delegates and dataSources for a variety of purposes
- Custom sorting
- Persisting state between app launches
For this assignment you will be writing a simple To Do List app for the iPhone. Your application must contain the following elements…
- The main window should be a navigation-based application
- The table view area should be composed of the items that have been added to the to do list
- An add button that allows the user to add additional tasks to the list
- A segmented control that defines the sorting order of the list (by name or percentage completed)
- An edit button which brings up delete mode
- Each table cell should include the following:
- The primary row should be the task title
- The secondary row should be the percentage completed for the given task
- The add view should contain the following:
- A multi-line text entry where the user can enter the task
- A slider that allows the user to estimate the percent completed for a given task
- A text label that displays the value of the slider in real-time as the user adjusts it
When your app initially loads it should look similar to the image shown below. Note that when the app loads for the first time the sorting behavior defaults to “A-Z”.
If a user presses the add button, they should be taken to an “Add Task” screen that is populated without any values as shown below. Since the only place the user can type is in the multi-line text field, your application should automatically display the keyboard and focus the cursor within the text box when this view is loaded:
Here the user has specified as task name of “TPS reports” and has selected a percentage completed of 25%. Your application should display the current value of the slider widget (between 0 and 100) as a whole number. This number should update in real-time as the user slides the handle back and forth.
Once the user has entered a value and presses the back button, the newly added item should automatically be populated in the table. The task shows the task name on the primary line and shows the percentage completed neatly formatted (again as a whole number) on the secondary line. Additionally, there should be a disclosure arrow to let the user know that the cell can be edited.
As the user adds tasks, they should be automatically inserted into the list in the appropriate order. Here we see that the user has entered “Assignment 4” which now appears at the top of the list.
Here the user has added “Disassemble cube walls” to the list, again it is placed in the correct position within the list.
In addition to sorting by task names, your application should also support sorting based on the percentage completed. Here we see the result of the user pressing the “0-100” sort segment — the list is automatically re-sorted.
In addition to supporting the addition items, your application must also support editing items by clicking on a table cell. Here the user has clicked on the “TPS reports” line and has changed the percentage completed up from “25%” to “60%”.
If the user adjusts either the task name or the percentage complete and presses the back button, the task should be re-positioned in the table according the new values. Here we see that “TPS reports” has moved from the second to the third position (as it is the most completed).
In addition to re-positioning a task, if a user edits a task to “100%” the task should appear dimmed to indicate that it is not longer in need of completion. Here we see that the user has adjusted “Assignment 4” to 100% and it is grayed out accordingly.
Here the user has clicked on the “A-Z” segmented control, thus re-sorting the list alphabetically.
Your application should also have an edit button that allows the user to perform mass deletes.
Additionally, your application should support the “swipe to delete” behavior.
Your application should persist the To Do list to the local file system, such that it remains intact between application launches.
Additionally, your application should remember to save and restore the sorting behavior between runs of the application. This includes the actual sorted order of the list as well as restoring the segmented control to select the appropriate segment. Once a user adds an item or changes the sorting behavior you should be able to close and re-launch the app and restore the list as it was.
Like the previous assignment, there’s not that much opportunity for the user to enter bad data when using this app. Though you should be sure to handle the case where the user hits the back button in the add view without entering any data. There are a couple of acceptable approaches to solving this problem including giving the item a dummy name (such as “Unnamed Item”) or simply not performing the insert.
The first thing I’d probably do is to print out images of main and add screens and start to think about about and identify…
- Where do you need (and not need) outlets?
- What instance variables you will need?
- What action methods (and which of the 3 forms) do you need?
- What interactions call which action methods?
- What (if any) custom classes do I need?
Next, I’d probably recommend building the app and getting things up and running without persisting the state of the app. Adding in this persistence should be fairly easy once everything else is working. Though, you’ll probably want to think about the following persistence issues…
- What all needs to be persisted?
- How should you model the data that needs persisting?
- Where and when should you load and save data?
Some final hints…
- NSMutableArray has several methods for rearranging content. If you go the NSSortDescriptor route, there is an accompanying Sort Descriptor Programming Topics guide which you may find useful
- We briefly talked about different built-in cell styles in class. For more information about table styles, you should probably check out the Standard Styles for Table-View Cells section of the Table View Programming Guide for iPhone OS guide.
The following items are provided as thoughts as to how you might extend or improve the project beyond the basic requirements. You are not required to implement any of these.
- Try out alternate color combinations — just don’t make my eyes bleed
- Feel free to play with the layout and style of elements — just be sure that things are neatly aligned and that there is at least some justifiable method to your madness
- Add images to the app if you think it will improve the look and feel of the application
- I’m open to using alternate input/display mechanisms — just send me an email to tell me what you’re thinking and I’ll let you know if it is acceptable
Your projects will be graded on the following criteria:
- Correctness of application
- Appearance of application
- Adherence to Objective-C and iPhone coding conventions
- Neatly formatted and indented code
- Well documented header files
- Absence of significant performance issues
- Absence of memory leaks
Like the previous assignment, you are required to submit a zip file of your project directory. Be sure to manually remove the build directory before zipping things up.
To submit the assignment, open up a terminal, navigate to your zip file then issue the command:
submit cs491i assignment4 Assignment4.zip
If developing on your own Mac, you’ll need to transfer the file into your GL account (via SCP), then SSH into GL and issue the submit command.