//
//  UIScrollView+TouchEvent.m
//  UIScrollView内で受けているタッチイベントを外部で受けられるようにするカテゴリ
//
//  Created by AIG-Soft(iMac) on 2015/06/23.
//  Copyright (c) 2015年 AIG-Soft. All rights reserved.
//

#import "UIScrollView+TouchEvent.h"

@implementation UIScrollView (TouchEvent)

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
	printSelf();
	[[self nextResponder] touchesBegan:touches withEvent:event];
	if ([self.delegate respondsToSelector:@selector(scrollTouchesBegan:withEvent:)]) {
		[self.delegate performSelector:@selector(scrollTouchesBegan:withEvent:) withObject:touches withObject:event];
	}
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
	printSelf();
	[[self nextResponder] touchesMoved:touches withEvent:event];
	if ([self.delegate respondsToSelector:@selector(scrollTouchesMoved:withEvent:)]) {
		[self.delegate performSelector:@selector(scrollTouchesMoved:withEvent:) withObject:touches withObject:event];
	}
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
	printSelf();
	[[self nextResponder] touchesEnded:touches withEvent:event];
	if ([self.delegate respondsToSelector:@selector(scrollTouchesEnded:withEvent:)]) {
		[self.delegate performSelector:@selector(scrollTouchesEnded:withEvent:) withObject:touches withObject:event];
	}
}

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
	printSelf();
	[[self nextResponder] touchesCancelled:touches withEvent:event];
	if ([self.delegate respondsToSelector:@selector(scrollTouchesCancelled:withEvent:)]) {
		[self.delegate performSelector:@selector(scrollTouchesCancelled:withEvent:) withObject:touches withObject:event];
	}
}

@end
