Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 49 lines (43 sloc) 1.434 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/* ViewDelegator.h UIView subclass to delegate touches, motions, and
* drawRect:
*
* Copyright (c) 2011 Psellos http://psellos.com
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*/

/* Protocol for the delegate.
*/
@protocol ViewDelegate
@optional
- (BOOL) viewCanBecomeFirstResponder: (UIView *) view;

- (void) view: (UIView *) view
         touchesBegan: (NSSet *) touches
         withEvent: (UIEvent *) event;
- (void) view: (UIView *) view
         touchesCancelled: (NSSet *) touches
         withEvent: (UIEvent *) event;
- (void) view: (UIView *) view
         touchesEnded: (NSSet *) touches
         withEvent: (UIEvent *) event;
- (void) view: (UIView *) view
         touchesMoved: (NSSet *) touches
         withEvent: (UIEvent *) event;

- (void) view: (UIView *) view
         motionBegan: (UIEventSubtype) motion
         withEvent: (UIEvent *) event;
- (void) view: (UIView *) view
         motionCancelled: (UIEventSubtype) motion
         withEvent: (UIEvent *) event;
- (void) view: (UIView *) view
         motionEnded: (UIEventSubtype) motion
         withEvent: (UIEvent *) event;

- (void) view: (UIView *) view drawRect: (CGRect) rect;
@end

/* Interface for the delegator.
*/
@interface ViewDelegator : UIView
{
    NSObject<ViewDelegate> *delegate;
}
@property(nonatomic, assign) IBOutlet NSObject<ViewDelegate> *delegate;
@end
Something went wrong with that request. Please try again.