У меня есть uiscrollview с uiimageview внутри. Я подкласс uiscrollview, но я не могу получить прикосновения к работе touchbegin не называется Что я должен сделать, чтобы вызвать событие uitouch?
что не так?
.h
#import <UIKit/UIKit.h>
@interface myScrollView : UIScrollView {
}
@end
.m
#import "myScrollView.h"
@implementation myScrollView
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
if (touch.view.tag > 0) {
touch.view.center = location;
}
NSLog(@"tag=%@", [NSString stringWithFormat:@"%i", touch.view.tag]);
}