Resizable image with caps
suggest changeIn the example of a message bubble illustrated below: the corners of the image should remain unchanged which is specified by UIEdgeInsets
, but the borders and center of the image should expand to cover the new size.
![](/essential/ios/img/1e93422e5b98a3e8bf5af679da350b8dbdd031c7.png)
![](/essential/ios/img/1529b42723ec19cca206b112eb6306e75bdf370b.png)
let insets = UIEdgeInsetsMake(12.0, 20.0, 22.0, 12.0)
let image = UIImage(named: "test")
image?.resizableImageWithCapInsets(insets, resizingMode: .Stretch)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents