Day 12 at Mobile Makers (Auto Layout, Constraints)

Auto layout and constraints were the two topics of the hackwitch today. I am pretty comfortable with the basics of these because I did some tuitorials before coming to Mobile Makers. I think the key with these two items is to practice practice practice and try to have your app as laid out as possible in storyboard before putting constraints on objects.

Some things we re-went over today included delegates. A Delegate is a way for two objects to interact. They perform functions for an object without another object knowing about it. We discussed the app delegate for the first time and found out that it is loaded every time the app starts. So we want to limit what goes into it because it will take longer to load if we put too many things in it.

One topic for me that is still hard to wrap my brain around is blocks. I know blocks happen when we don’t know how long something is going to take when we are retrieving data from an outside source. They also almost always happen asynchronously, meaning in the background while other stuff is still going on. This benefits the app because it isn’t waiting for everything from the block to come back before moving on with other tasks.

A random cool Xcode trick I learned today is that when the stimulator is open, you can press command left arrow or right arrow and it will change from portrait to landscape view and vice versa. This is really useful when using autolayout and different constraints.

A small reminder I had today when building a project was that primitives are not objects, thus you cannot put them in an array. Only objects can go in an array. Primitives are bool, float, int, double etc…so you must have NSNumber when you have class properties that are numbers that are going into an array because NSNumber is an object.

image

 

Above is a picture of something I made while trying to understand maps and map kit better. It really helped to write everything out and step back and see how everything worked.

-Blake

Leave a comment