Created
October 19, 2011 09:15
-
-
Save arbales/1297810 to your computer and use it in GitHub Desktop.
Fallback for resizable images for old versions of iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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