私のアプリでは、画面上で円をドラッグすることができます。私は、これを実装するために取るべき標準的なステップがあるかどうか、特にビューの正しい領域を汚れているとマークすることに関しては疑問に思っています。私は現在、次のことをやっている:iOS:drawRect:draggableオブジェクトを実装する際の標準規則
//Get initial touch point and draw a circle there. Use touch point and size of circle to pass the mark the appropriate CGRect as dirty so that it gets redrawn
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
//Get new touchpoint and draw a circle there. Use the union of the previous CGRect and the new one (based on the touch point and circle size) to tell drawRect: what area of the screen to redraw.
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
は、これは正しいように見える場合、または私がやるべきいくつかの他の基本的な部分はありますか?
コードを追加しましたか?あるいは、あなたはそれらの方法を実装しているということだけですか? – ThomasW
私は実装の詳細を心配していないので、コードを追加するつもりはありませんでした。もちろん – maxedison