私は1つのアプリケーションを開発しています。私は1つのUIImageViewを使用しており、以下のコードを使用して0.5秒ごとにUIImageViewの位置を変更しています。
[NSTimer scheduledTimerWithTimeInterval:0.5
target: self
selector:@selector(moveImage)
userInfo: nil repeats:YES];
-(void) moveImage
{
//[image1 setCenter: CGPointMake(634, 126)];
CGFloat x = (CGFloat) (arc4random() % (int) self.view.bounds.size.width);
CGFloat y = (CGFloat) (arc4random() % (int) self.view.bounds.size.height);
CGPoint squarePostion = CGPointMake(x, y);
img.center=squarePostion;
}
画面にタッチできるようになりました。私が知る必要があるのは、私のタッチ位置とそのイメージビューの位置の両方が正しいかどうかです。