I saw many examples of how to draw a rounded rectangle using iPhone SDK. What I really need is a trimmed corner rectangle, something that will look as follows:

Thanks,
Josh
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(This is edited to take Jonathan Grynspan’s suggestion and just use the helper function to create a path. It also now allows for the trimmed corner’s height to be different from its width.)
Here is a helper C-function to create a such a path:
And here is how you would use this in your custom view’s -drawRect: method: