Assignment 4

Due Date

Tuesday, October 13th — 11:59pm

Background

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

Task

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

Behavior

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”.

Initial Screen

Initial Screen

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:

Item Add Screen

Item Add Screen

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.

Adding TPS Reports

Adding TPS Reports

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.

The Added TPS reports

The Added TPS reports

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.

Added Assignment 4

Added Assignment 4

Here the user has added “Disassemble cube walls” to the list, again it is placed in the correct position within the list.

Added Disassemble cube walls

Added Disassemble cube walls

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.

Sorted by Percentage Complete

Sorted by Percentage Complete

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%”.

Editing TPS reports

Editing TPS reports

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).

The Edited TPS reports

The Edited TPS reports

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.

Assignment 4 After Editing to 100%

Assignment 4 After Editing to 100%

Here the user has clicked on the “A-Z” segmented control, thus re-sorting the list alphabetically.

Sorted by Task Name

Sorted by Task Name

Your application should also have an edit button that allows the user to perform mass deletes.

Edit Button Deletions

Edit Button Deletions

Additionally, your application should support the “swipe to delete” behavior.

Swipe to Delete

Swipe to Delete

Persisting Data

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.

Error Handling

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.

Hints

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…

Additional Ideas

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

Grading

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

Submission

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: