Member-only story

Resizable image with Caps iOS

Mr.Javed Multani
1 min readOct 5, 2020

--

In 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.

let insets = UIEdgeInsetsMake(12.0, 20.0, 22.0, 12.0)
let image = UIImage(named: "test")
image?.resizableImageWithCapInsets(insets, resizingMode: .Stretch)

--

--

Mr.Javed Multani
Mr.Javed Multani

Written by Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer

No responses yet