This works, and if drawing a rounded-rectangle with Quartz is not an option for some reason, this can be used. However, doing this kind of work with Core-Animation properties introduces performance hits because of some subtle compositing and rendering issues. In many cases, you will have better performance if you just use Quartz and draw the border directly in a custom view.
What I observed is, going with layer property change, will draw the colored border (line) over the subviews also.
For eg : if we draw a UIView (with rounded layer cornered, using layer property and larger width) , with a subview of text box. Then the border gets drawn over the textbox view also.
If I go with some coregraphics (i tried using stroke and clipping previous), found the border doesn't gets override.
So what I am trying is , draw rounded, colored border for an UIView with following are my points to consider :
i) without using clipping and stroking , as it will clip the other part of the bordered stroke.
ii) without modifying internal layer of the view object, as it will override the colored border on the internal successive subviews if the border width exceeds for some reason (change in design)..
Trying using insets for the multiple rectangles and changing the color .. the other way around.. will update..