iDevGames Forums
UIResponder issues - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: UIResponder issues (/thread-8094.html)



UIResponder issues - Dre2000lbs - Sep 10, 2010 12:40 PM

Hey,

I want to create a TouchDelegate class that inherits UIResponder. Right now, a UIView object taking the touch respondes instead of my instantiated TouchDelegate. How do I set TouchDelegate to receive touch respondes without it being a UIView or something similar?

Code:
//
//  TouchDelegate.h

//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#ifndef __TOUCH_DELEGATE__H_
#define __TOUCH_DELEGATE__H_

#import <UIKit/UIResponder.h>
#import <Foundation/Foundation.h>

@interface TouchDelegate : UIResponder {
    NSArray* my_beginning_touches;
    NSArray* my_moving_touches;
    NSArray* my_end_touches;
    NSArray* my_cancelled_touches;
}

@property (readonly) NSArray* my_beginning_touches;
@property (readonly) NSArray* my_moving_touches;
@property (readonly) NSArray* my_end_touches;
@property (readonly) NSArray* my_cancelled_touches;


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

- (BOOL)isFirstResponder;


@end

#endif

Thanks