Fixing Warnings in Trevor Harmon’s UIImage Categories

Resizing images, cropping them to a specific thumbnail size, applying rounded corners is extremely easy with Trevor Harmon’s UIImage categories. In fact, they proved to be invaluable to my latest project (there is not need to reinvent the wheel with my own code).

But if you add original files, the compiler will generate a few warnings. Warnings like:

Luckily they are extremely easy to fix. For the first error, you’ll need to remove private helper method declarations from every category. The second warning can be fixed by adding default switch statement (default:break; will work just fine).

If you simply want to download the fixed code, you can do so here.

Fixing Warnings in Trevor Harmon’s UIImage Categories

2 thoughts on “Fixing Warnings in Trevor Harmon’s UIImage Categories

  1. Ahmad Ansari says:

    There is no need to remove the private method declarations. You just need to add default case with a break statement for both warnings.

    And, the warning “Category is implementing a method which will also by its primary class”, add following two lines before the method definition:

    #pragma clang diagnostic push
    #pragma clang diagnostic ignored “-Wobjc-protocol-method-implementation”

Leave a Reply

Your email address will not be published. Required fields are marked *