Wednesday, April 8, 2015

Week 8

Dear Blog-Viewers,

I apologize for being late to post this week. I took the weekend off for a trip around the southwest with my Norwegian relatives. I've been working hard on the road, but I haven't had a reliable internet connection to publish my blogpost. 

Anyways, here is a picture from beautiful Antelope Canyon:



Now that I've distracted you by my personal endeavors, here is what I have been working on with respect to my EcoMap project:

This week I solved the puzzle of creating layouts for multiple devices. If you're like me and have an older iPhone, you probably still want the same content that the people on the newest devices are receiving. This is why Apple developed something called auto layout. The only problem is that the keyword, "auto," is quite deceiving. Each item on the screen requires the programmer to create constraints for height, width, x position, y position, and aspect ratio. And it's even more complex because each screen for each device is not merely a scale up from the next screen, but the screens have different aspect ratios as well. So my jobs was to set constraints for elements with regards to each other element on the page.



Finally, I got the screen layouts to look the same on all devices as you can see on the right of the image above. 

So this week, I figured out how to use auto-layout. Then I created a segue from the table view (that you've all seen in previous blog posts) to a detail view that gives the user more detail for the touched compost service. Touching the table row for "Recycled City" now takes the user to a new detailed view that will soon provide more information than simply a title, description, and an image. 



It's really exciting to see this all come together. As you can see, the app is now on my physical iPhone (not only on a simulator). I found out how to get the app running without a developer account before actually paying to put it on the app store. It seems that with each advancement comes new issues. Now I am trying to make the app more efficient, saving the iPhone battery and making the app run faster. 

I am still working to figure out how to get data from organizations about what they need more of in terms of carbon or nitrogen at a certain time. For now, I have created a simple layout for how this data will be displayed on the device. In the above image to the left, you can see the Lewis Dot Structure for Carbon and Nitrogen. (Please correct me if the structures are incorrect. It's been a while since I've taken chemistry.) "Phx Renews," for example, needs more Nitrogen than Carbon at the moment. Touching either of these buttons will take the user to a page that describes what organic materials fit into each category.

As always, let me know if there is anything you don't understand. I think the app will be finished soon for all of you to try!

2 comments:

  1. First off, Antelope Canyon is gorgeous. Better than Grand Canyon imo
    Secondly, your app has a really nice, minimalist aesthetic! The atom models are a nice touch.
    Out of curiosity, how exactly do you give your app GPS/map capabilities?

    ReplyDelete
    Replies
    1. The GPS/map capabilities are partly built in to the Swift MapKit framework. So I really just needed to get the coordinates and much of the rest was taken care of through built in methods. Right now, I am trying to set up a button that takes the user to the actual maps app for navigation.

      Delete