Skip to content

Instantly share code, notes, and snippets.

@frankus
Created December 16, 2013 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankus/7992755 to your computer and use it in GitHub Desktop.
Save frankus/7992755 to your computer and use it in GitHub Desktop.
Category on UIBarButtonItem for flexible space (add an `autorelease` call for non-ARC code).
@interface UIBarButtonItem (FlexibleSpace)
+ (instancetype)barButtonItemFlexibleSpace;
@end
@implementation UIBarButtonItem (FlexibleSpace)
+ (instancetype)barButtonItemFlexibleSpace {
return [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment