If you’re using PaintCode you might want to have
drawrect code that scales depending on your needs. I’m sure there are multiple ways to achieve this. I use the help of two macros I call “MyMacroForX” and “MyMacroForY” for now which translate the given float value based on the dimensions of the UIView I set in Interface Builder or code. Unfortunately PaintCode does not provide you anything to help with adding those macros to it’s generated code.
Let’s assume you have a more complex shape than a circle, multiple layer and so on. You end up pretty quickly having lots of CGPointMake calls like
but want something like
Xcode offers search and replace based on regular expressions which is a great solutions if your don’t want to spent an hour copy & pasting.
Set the style in your Replace options to Regular Expression. It’s also useful to define a custom search scope for the upcoming task (if your don’t want to replace all occurrences in your project).
The find pattern I use looks like this
As replace pattern I use
This saved me a lot of time in the past and I’m sure it will in the future.