ImagePickerControllerのタッチイベントをカスタマイズしたい
公開日:
:
最終更新日:2013/11/08
iOSアプリ開発
UIImagePickerControllerを継承して、touchesEndedをオーバーライドする作戦だったんだけど、touchesEndedが呼ばれていない模様。うーん。どうすればカスタマイスできるんだろう?
@interface MyImagePickerController : UIImagePickerController {
}
@end
@implementation MyImagePickerController
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"%s", __func__);
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"%s", __func__);
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"%s", __func__);
}
- (void)dealloc {
[super dealloc];
}
@end
// イメージピッカーを作る
MyImagePickerController* imagePicker;
imagePicker = [[MyImagePickerController alloc] init];
[imagePicker autorelease];
imagePicker.sourceType = sourceType;
imagePicker.allowsImageEditing = YES;
// イメージピッカーを表示する
[self presentModalViewController:imagePicker animated:YES];