Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Objective-c block categories and subclasses
branch: master

This branch is 52 commits behind kgn:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
BBNSButton.h
BBNSButton.m
BBUIGestureRecognizer.h
BBUIGestureRecognizer.m
BBlock.h
BBlock.m
NSApplication+BBlock.h
NSApplication+BBlock.m
NSArray+BBlock.h
NSArray+BBlock.m
NSButton+BBlock.h
NSButton+BBlock.m
NSDictionary+BBlock.h
NSDictionary+BBlock.m
NSImage+BBlock.h
NSImage+BBlock.m
NSObject+BBlock.h
NSObject+BBlock.m
NSTimer+BBlock.h
NSTimer+BBlock.m
NSURL+BBlock.h
NSURL+BBlock.m
UIActionSheet+BBlock.h
UIActionSheet+BBlock.m
UIAlertView+BBlock.h
UIAlertView+BBlock.m
UIImage+BBlock.h
UIImage+BBlock.m
license
readme.md

readme.md

BBNSButton.h

@interface BBNSButton : NSButton

Set the callback block to be called when the mouse enters the button.

- (void)setInCallback:(BBNSButtonCallback)block;

Set the callback block to be called when the mouse exits the button.

- (void)setOutCallback:(BBNSButtonCallback)block;

Set both the enter* and **exit callback blocks.

- (void)setInCallback:(BBNSButtonCallback)inBlock andOutCallback:(BBNSButtonCallback)outBlock;

BBUISwipeGestureRecognizer.h

@interface BBUISwipeGestureRecognizer : UISwipeGestureRecognizer

- (id)initForDirection:(UISwipeGestureRecognizerDirection)direction withAction:(BBUISwipeGestureRecognizerAction)action;

BBlock.h

@interface BBlock : NSObject

Execute the block on the main thread

+ (void)dispatchOnMainThread:(void (^)())block;

NSArray+BBlock.h

@interface NSArray(BBlock)

Enumerate each object in the array.

- (void)enumerateEachObjectUsingBlock:(void(^)(id obj))block;

NSButton+BBlock.h

@interface NSButton(BBlock)

WARNING: This category is still in early development. Currently the order of calling these methods is important:

  1. setImage
  2. setAlternateBackgroundImage
  3. setBackgroundImage

Tries to mimic UIButton by exposing a method to set the background image. The image set with setImage is composited on-top of the background image.

- (void)setBackgroundImage:(NSImage *)backgroundImage;

Tries to mimic UIButton by exposing a method to set the alternate background image. The image set with setAlternateImage is composited on-top of the alternate background image. If no alternateImage is set image will be used instead.

- (void)setAlternateBackgroundImage:(NSImage *)alternateBackgroundImage;

NSImage+BBlock.h

@interface NSImage(BBlock)

Returns a NSImage rendered with the drawing code in the block. This method does not cache the image object.

+ (NSImage *)imageForSize:(NSSize)size withDrawingBlock:(void(^)())drawingBlock;

Returns a cached NSImage rendered with the drawing code in the block. The NSImage is cached in an NSCache with the identifier provided.

+ (NSImage *)imageWithIdentifier:(NSString *)identifier forSize:(NSSize)size andDrawingBlock:(void(^)())drawingBlock;

NSTimer+BBlock.h

@interface NSTimer(BBlock)

+ (id)timerWithTimeInterval:(NSTimeInterval)timeInterval andBlock:(void (^)())block;
+ (id)timerRepeats:(BOOL)repeats withTimeInterval:(NSTimeInterval)timeInterval andBlock:(void (^)())block;
+ (id)scheduledTimerWithTimeInterval:(NSTimeInterval)timeInterval andBlock:(void (^)())block;
+ (id)scheduledTimerRepeats:(BOOL)repeats withTimeInterval:(NSTimeInterval)timeInterval andBlock:(void (^)())block;

UIImage+BBlock.h

@interface UIImage(BBlock)

Returns a UIImage rendered with the drawing code in the block. This method does not cache the image object.

+ (UIImage *)imageForSize:(CGSize)size withDrawingBlock:(void(^)())drawingBlock;

Returns a cached UIImage rendered with the drawing code in the block. The UIImage is cached in an NSCache with the identifier provided.

+ (UIImage *)imageWithIdentifier:(NSString *)identifier forSize:(CGSize)size andDrawingBlock:(void(^)())drawingBlock;
Something went wrong with that request. Please try again.