The end-cap insets.
- iOS 5.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
End caps specify the portion of an image that should not be resized when an image is stretched. This technique is used to implement buttons and other resizable image-based interface elements. When a button with end caps is resized, the resizing occurs only in the middle of the button, in the region between the end caps. The end caps themselves keep their original size and appearance.
This property specifies the sizes of all four end caps. The middle (stretchable) portion consists of all the pixels that are not included in the end caps. These pixels are tiled, left-to-right, top-to-bottom to fill the remaining space.
On a non-resizable image, this property is set to
UIEdge; the image does not use end caps and the entire image is subject to stretching. To create a new image with a nonzero value for this property, use the
resizable method. If your application specifies
UIEdge as the
cap parameter, the entire image is tiled.