NSEnumerator 和 UIInterpolatingMo

2018-05-23  本文已影响10人  zhao1zhihui
 UIInterpolatingMotionEffect *motionEffect; motionEffect = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; 
motionEffect.minimumRelativeValue = @(-25); 
motionEffect.maximumRelativeValue = @(25);
 [messageLabel addMotionEffect:motionEffect];
 motionEffect = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; 
motionEffect.minimumRelativeValue = @(-25); 
motionEffect.maximumRelativeValue = @(25); 
[messageLabel addMotionEffect:motionEffect];
NSEnumerator *enumerator = [array reverseObjectEnumerator];  
        id obj = nil;  //不确定数组里面具体对象的类型,所以定义成id 类型指针  
        while (obj = [enumerator nextObject]) { //通过枚举器,取数组里面的每一个元素  
            NSLog(@"%@", obj);                  //将元素赋给 obj, 直到数组结束  
                                                //取到的结果为nil,退出while  
        }  
上一篇下一篇

猜你喜欢

热点阅读