We're well on the way to know how to set a time and date for the reminder notification to occur, and we will be able to sort the reminders based on the distance from where we are. However, what exact information do we need in the reminder itself?
If this were a birthday reminder app, you would just need to ask for the person's name and the date of their birthday. If it were a shopping list app, you would need the name of the item and maybe the quantity. For a timer, you would need to ask what the event is called and would need to set a time for the event.
Here though, we're trying to make a completely flexible reminder app; it would be up to the user to describe the item in whatever manner they wish. So, we'll just ask for a title and a brief description. We will also need to offer the option of setting a date, time, an associated location, and whether an alert sound should be played.
Another thing to think about is; where will we store the information for the list of reminders? While making the WebScraper app in Chapter 4, Using Remote Data and Media, we chose to duplicate the main application stack into the documents folder and to then jump into that copy of the stack. This enabled the ability to save changes to the stack. The reminder app is a simpler case; we're only trying to store a few text strings to define each reminder and it would be simpler to just write a text file using this app.
We want to allow the user to make a list of locations, so that a reminder can be associated with that location. Rather than writing a different text file, we will make the first piece of information in each entry be the function of that entry. Right now, the only two functions are location
and reminder
. The following is an example of how the text file might look:
Location Home 40.692636 -73.978376 Location Office 40.745194 -73.985199 Reminder Packt Ask for more time! 1334548800 Home false Reminder Boss Buy lunch 1334592000 Office true
Between each item in the line is a tab character, which will be used to separate the parts of the entry. The structure for a location is:
Location
For a reminder, it's:
Reminder
true
or false
)