Day 11 at Mobile Makers (CLLocation, MKDirections, MKLocalSearch

Today was the most challenging day so far at Mobile Makers by far. We got the location of the current user while also being able to find locations near that user based on a search. There are what seem like to be 10+ new class methods that were thrown at us today. I am glad tomorrow is the weekend so I can catch up and look through them all and read the documentation and really see what they do.

It was a challenging today but I am glad we are learning about maps and locations. It is an essential skill to master to be an IOS developer. I plan on doing a lot of mini side projects this weekend to really grasp the steps in being able to use maps.

One cool thing I learned today while Max was teaching, is that you can have a NSMutableString. With this mutable string you can append items to it so that you have a list of items or directions etc… Here is an example…

[directionsString appendFormat:@”%d: %@ \n”, x++, step.instructions];

The NSMutableString is named directionString and what we are doing taking each instruction in the step and assigning it a value of X, which starts at 1 and then increments up from there by one each time. The ++ after the X increments it and if you did minus minus on the other side of the X it would decrement it. So in this example, we are printing out directions to a location and giving the directions step numbers so they are easier to read. The \n makes a new line so that each numbered direction is on its own line. This was very useful to learn and I anticipate using it quite often in the future. BTW- we had the above code in a for loop that was iterating over the steps of a whole route and that’s how we were getting each one. Instructions is a property of steps, which is of class MKRouteStep.

Tomorrow is auto layout and constraints. I have a little practice with them and I know it is going to be extremely challenging. I’m excited to learn all the best practices associated with auto layout.

-Blake

Leave a comment