Assignment #5 Extra Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

Allow the user to switch between a normal map view, a satellite map view and a hybrid map view (you’ll likely want to use a UISegmentedControl for this).

During the lazy instantiation of the map view add an additional sub view for a control segment. The control segment is initialized with an array holding the three possible selections. Its position is calculated by using the horizontal center of the map, and subtracting the size of the segment from the height of the map. To enable auto-rotation the the left and right as well as the top margin are set to be flexible (equal to a spring in story board). The “normal” view is set as initial view. When the value of the control segment is changed, the method changeMapType: is called.
Continue reading “Assignment #5 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Extra Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add a photo’s thumbnail image (FlickrFetcherPhotoFormatSquare) to every row in any table view that shows a list of photos. Don’t ask Flickr for the image data of thumbnails that never appear on screen (i.e. fetch thumbnail image data only on demand). There’s no need to cache these images (they are very small). Obviously when a row first appears, it will not have the thumbnail image, but, sometime later, when the thumbnail data comes back from Flickr (and if the row is still on screen), it should appear. Beware Required Task #1. And consider the hint above about not calling UI methods from outside the main thread and also remember that table view cells are reused as the scroll on and off screen.

Basically the procedure is the same as for the annotation views. Check if the table item is photo, download its photo asynchronously and put it on screen back in the main queue. The only difference is that it is necessary to put an placeholder image into the cell otherwise it is not possible to update the image once it has been loaded:
Continue reading “Assignment #5 Extra Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Task #8

Please note, this blog entry is from a previous course. You might want to check out the current one.

Your must get your application working on a device this week. Obviously we are not going to be able to check this, so it is on you (and the honor code) to check yourself on this required task.

… done. Code from previous tasks works without modification on iPad first Generation iOS 5.1.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Task #6

Please note, this blog entry is from a previous course. You might want to check out the current one.

When a map view of photos appears on screen, its region should be set to the minimum size that fits all of its annotations (with an aesthetically-pleasing padding around them).

First iterate over all annotations and save the minimum and maximum values for longitude and latitude. Next create a region and set its center and size using this variables. To get the aesthetically-pleasing padding increase the size of the region by 10 %. If there is only on annotation the size would be zero, which can be prevented by randomly set it to a square of one by one degrees.
Continue reading “Assignment #5 Task #6”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #5 Task #5

Please note, this blog entry is from a previous course. You might want to check out the current one.

Anywhere in your application where a list of photos or places appears, give the user an option (via some UI of your choice) to view information in the list on a map instead. Each annotation on the map should have a callout which displays the following:
a. The title of the photo or the name of the place.
b. In the case of a photo, its description (at least the first few words of it, if any) and a thumbnail image (FlickrFetcherPhotoFormatSquare) of the photo. It is okay if the callout shows up initially without the thumbnail, but as soon as you are able to retrieve it from Flickr (assuming the callout is still on screen at that point), the thumbnail should appear. Beware Required Task #1.
c. A disclosure button which brings up the full image of the chosen photo (exactly as if the user had chosen the photo from a table) or which brings up a list of photos in that place (again, exactly as if the user had chosen that place from a table).

First we start by adding a button to the navigation toolbar to allow displaying a map and a second one for displaying the table again when the map is on screen. Because we will need this functionality in all tables we will put this code into the common-table-view-controller class:
Continue reading “Assignment #5 Task #5”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail