Declared in UIView+BlocksKit.h

Overview

Convenience on-touch methods for UIView.

Includes code by the following:

Warning: UIView is only available on a platform with UIKit.

Tasks

Instance Methods

bk_eachSubview:

- (void)bk_eachSubview:(void ( ^ ) ( UIView *subview ))block
Discussion

A convenience wrapper that non-recursively loops through the subviews of a view.

Parameters

block

A code block that interacts with a UIView sender.

Declared In

UIView+BlocksKit.h

bk_whenDoubleTapped:

- (void)bk_whenDoubleTapped:(void ( ^ ) ( void ))block
Discussion

Adds a recognizer for one finger tapping twice.

Warning: This method has an additive effect. Do not call it multiple times to set-up or tear-down. The view will discard the gesture recognizer on release.

Parameters

block

The handler for the tap recognizer

Declared In

UIView+BlocksKit.h

bk_whenTapped:

- (void)bk_whenTapped:(void ( ^ ) ( void ))block
Discussion

Adds a recognizer for one finger tapping once.

Warning: This method has an additive effect. Do not call it multiple times to set-up or tear-down. The view will discard the gesture recognizer on release.

Parameters

block

The handler for the tap recognizer

Declared In

UIView+BlocksKit.h

bk_whenTouches:tapped:handler:

- (void)bk_whenTouches:(NSUInteger)numberOfTouches tapped:(NSUInteger)numberOfTaps handler:(void ( ^ ) ( void ))block
Discussion

Abstract creation of a block-backed UITapGestureRecognizer.

This method allows for the recognition of any arbitrary number of fingers tapping any number of times on a view. An instance of UITapGesture recognizer is allocated for the block and added to the recieving view.

Warning: This method has an additive effect. Do not call it multiple times to set-up or tear-down. The view will discard the gesture recognizer on release.

Parameters

numberOfTouches

The number of fingers tapping that will trigger the block.

numberOfTaps

The number of taps required to trigger the block.

block

The handler for the UITapGestureRecognizer

Declared In

UIView+BlocksKit.h