The importance of custom primitive properties in CoreData

October 23, 2011

The topic of this week’s post is responsible for hours of frustrating debugging that I went through the first time I developed a large project using CoreData.

CoreData is really great once you learn how to use it properly, but it’s learning curve is pretty steep. And as if to complicate things a little further, the templates xcode is providing are pretty useless at best, and down right buggy in several cases.

Lets see an example where xcode’s template can cause severe bugs:

Read the rest of this entry »


Instantiating custom views from nib

October 18, 2011

Hi again everyone!

Subclassing UIView to create your own custom class is one of the most frequent tasks an iOS developer has to do.

And for me at least, every time that i created my own custom view, i was torn apart by what is the correct and more convenient way to design my view – from code or from interface builder. I always thought that there was no “right answer”, and that this decision depends on the scenario.
I was wrong. Using interface builder is better. Let’s see why.
Read the rest of this entry »


Animatable text color of UILabel

October 4, 2011

Every time I talk with an android developer about the strong and weak points of iOS development, I always have the CoreAnimation ace up my sleeve. Core animation is great. Not only that it’s so powerful and efficient, it’s also one of the most elegant frameworks I got the chance to work with. In 95% of the cases you can just write

 [UIView animateWithBlock:..] 

and pass a block with the final values of each property we want to animate.

Being the lazy developer that I am, the UIView animation block is a dream come true. This is why I get so annoyed when I encounter a non animatable property, like the text color property of UILabel. That’s right – UILabel, our main component for showing text on the screen, can’t animate all of its text related properties, like textColor, text, font, etc.

If we want to animate textColor, we have two simple but ugly options, and one complicated but delicious solution. Lets talk about the uglies first.
Read the rest of this entry »