Bloques y Grand Central Dispatch

El artículo publicado por Cocoa Samurai en 2009, desarrollado por Colin Wheeler, habla sobre Bloques, Grand Central Dispatch, patrones de diseño GCD y  las API que proporciona Cocoa para utilizar GCD y Bloques. En 2009, los métodos expuestos en el artículo se dirigía únicamente a OS X 10.6, sin embargo, con la mayor interacción de los Mac y iPhone con...

Code: iOS Freehand Drawing Part 1

There is some cases where we need to make a freehand drawing in our apps, for example to make a signature. This will be the first part of three post that will allow you to draw in a freehand way. Lets go! 1) Set up your project. If you don't know how to start maybe it's not your...

Code: Custom UIView from xib

If you are building a complex view, you can break it down in parts to make more readable the code and split the functionality on different UIView classes. Then you can instantiate your subviews from your main UIViewController.

Code: Custom pins in your map

Sometimes you need to add a custom pin to your map. You can use this piece of code to achieve that. Take a special look to the property "centerOffset" that allows to adjust your image from the center of your MKAnnotationView (usually you will set it as (0 , minus half...

Theory: Delegate patterns in Cocoa

The delegate pattern is a common and useful pattern in cocoa's environment like  properties and will be easy to implement if you have clear what you want to do. The first thing we need to know will be the concept of 'protocol', this is basically a declaration which methods are between two classes and...