30 days with swift — Day 10 — Finally programming

Guilherme Akio Sakae
3 min readMar 17, 2015

Missed the last day, check here:

We finally stated the hard work

So today we started to do some code ☺ I started with a single page application template and started to style the main screen, this screen are going to hold most of the information like, the precipitation chance, a icon (still need to find better ones), the week summary, your location and so on.

Here's what I did:

The first dashboard layout

After that I jumped to the view controllers and stated to put some code together, first I connected all the outlets. After that I wrote some code the get the current location of the user, I will need that to get the forecast. It was a little bit trickier because of the new apis in iOS 8, it took me about one hour to figure out how to use those apis properly.

After having all of the information that I need (latitude and longitude and the city name) I built a new struck called WeatherData to act as my api layer that way I can change my forecast provider without changing anything in the main code. I simple api call to the forecast api and I was ready to connect the dots.

This part was hard, this is my first project in swift without somebody showing me the directions, every code that I wrote so far was the treehouse course code so I spent a lot of time in the documentation searching how to do code in swift, code that I already know how to do in objective-c. I'm not complaining I'm expecting much more of that in the next few months, happens every time when you're learning a nem programming language.

Day Conclusion

That's it guys I'm really happy about the first day coding, We accomplished a lot today, I think we finished the first story:

As a users, I want to see the rain probability in the main screen

And that's pretty great, I've included a new story in my backlog to update the information in the screen when the user taps a button, I think that's very important to the experience. You can see the code at https://github.com/akiokio/wheresMyUmbrella I put tags to organize the code and separated them in days. The day one tag is already there and this is the day 01 result:

There's some needed improvements to this screen of couse

Hope you're enjoying, thanks!

--

--