ドラッグ可能なボタンが画面上の特定のポイントにドラッグされたときにイベントをトリガーするにはどうすればよいですか?
UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btn1 setFrame:CGRectMake(10.0f, 300.0f, 300.0f, 42.0f)];
[btn1 setTitle:[NSString stringWithFormat:@"View Fullscreen Decor"] forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(imageMoved:withEvent:) forControlEvents:UIControlEventTouchDragInside];
[self.view addSubview:btn1];
[super viewDidLoad];
[myScrollView addSubview:btn1];
- (IBAction) imageMoved:(id) sender withEvent:(UIEvent *) event
{
CGPoint point = [[[event allTouches] anyObject] locationInView:self.view];
UIControl *control = sender;
control.center = point;
}