在我的项目中,我在这里有 10 个这样的代码:
- (void) makeAnim1{
//downward animation for carousel
[UIView animateWithDuration:**3.5**
delay:0.25
options: UIViewAnimationCurveLinear
animations:^{
carousel.frame = CGRectOffset(carousel.frame, 0, **490**);
}
completion:^(BOOL finished){ //task after an animation ends
[self performSelector:@selector(makeAnim1_1) withObject:nil afterDelay:3.0];
NSLog(@"Done!");
}];
}
- (void) makeAnim1_1{
//upward animation for carousel
[UIView animateWithDuration:**3.5**
delay:0.2
options: UIViewAnimationCurveLinear
animations:^{
carousel.frame = CGRectOffset(carousel.frame, 0, **-480**);
}
completion:^(BOOL finished){
//timer for the reveal button
[NSTimer scheduledTimerWithTimeInterval:0.1 //this arranges the duration of the scroll
target:self
selector:@selector(revealButton)
userInfo:nil
repeats:NO];
NSLog(@"Done!");
}];
}
我想在一个简短的实现中制作它们。所以它们只是一个功能。我尝试将所需的值放入代码的粗体版本中并将它们分配。
我需要有两个彼此对应的数组。例如:
数组A[3] = A,B,C;
数组B[3] = a,b,c;
当A被选择时,它等于a。