私はiOSで一度に1つずつ画像をドラッグする方法を探しています(一度にたくさんではありません)。私はすでにこのような質問をし、いくつかの答えを得ましたが、うまくいきませんでした。私の状況は予想とは異なる可能性があるため、うまくいかなかったと思います。そのため、同じ質問を投稿しています。ジェスチャーが機能する可能性があると聞きましたが、さまざまな種類のコードを試しましたが、結果が得られませんでした。助けてください。
よろしくお願いします。
cowKeys = [[NSArray alloc] initWithObjects:@"cow",@"cow1",@"cow2",@"cow3",nil];
-(void) dealcows {
while (current cow <= 11) {
currentName = [NSMutableString stringWithFormat:@"%@.png", [cowsShuffled objectAtIndex:currentCard] ];
totalcowrValue = totalDealerValue + [[dictionary valueForKey:[cowsShuffled objectAtIndex:currentcow]] intValue];
UIImageView *imageView = [[UIImageView alloc] init];
if (currentcow== 1){
if (autoPlay == YES){
imageView.image= [UIImage imageNamed:currentName];
} else {
imageView.image= [UIImage imageNamed:currentName];
}
cow = (UIImageView *)[self.view viewWithTag:11];
cow.userInteractionEnabled = YES;
cow1 = (UIImageView *)[self.view viewWithTag:1];
cow1.userInteractionEnabled = YES;
}
}
}
- (void)touchesMoved:(NSSet *)set withEvent:(UIEvent *)event {
CGPoint a = [[set anyObject] locationInView:self.view];
CGPoint r = [[set anyObject] locationInView:self.view];
cow.center = a;
cow1.center = r;
}