Your code:
rect.top = 100;
rect.bottom = 100;
What do you expect? You are filling zero height rectangle and expectedly you don't see anything. The rest of the code is correct and is going to start working as soon as you fix rectangle.