Skip to content

Instantly share code, notes, and snippets.

@arbales
Created October 19, 2011 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arbales/1297810 to your computer and use it in GitHub Desktop.
Save arbales/1297810 to your computer and use it in GitHub Desktop.
Fallback for resizable images for old versions of iOS
- (UIImage *)resizableImageWithInsets: (UIEdgeInsets *)insets
UIImage *stretchableImage;
// Current OS Version
if ([UIImage respondsToSelector:@selector(resizableImageWithCapInsets:)]){
stretchableImage = [self resizableImageWithCapInsets: insets];
} else {
stretchableImage = [self stretchableImageWithLeftCapWidth:insets.left topCapWidth:insets.top];
}
return stretchableImage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment