Replace deprecated drawInRect: method on iOS 7 and higher

This has been bugging me for a little while — sorry I didn't send through a PR sooner.