2011-04-30 61 views
1

如果您认为此代码将被Apple拒绝,请告诉我。Apple会否拒绝此代码?

CATransition *animation = [CATransition animation]; 
animation.delegate = self; 
animation.duration = 0.3f; 
animation.timingFunction = UIViewAnimationCurveEaseInOut; 
animation.removedOnCompletion = NO; 
if (curlUp) 
{ 
    animation.type = @"pageCurl"; 
    animation.fillMode = kCAFillModeForwards; 
    animation.endProgress = 0.7; 
} 
else 
{ 
    animation.type = @"pageUnCurl"; 
    animation.fillMode = kCAFillModeBackwards; 
    animation.startProgress = 0.3; 
} 

// Perform the animation 
UIView *whitebg = [self.view viewWithTag:10]; 
NSInteger purple = [[whitebg subviews] indexOfObject:[whitebg viewWithTag:99]]; 
NSInteger white = [[whitebg subviews] indexOfObject:[whitebg viewWithTag:100]]; 
[whitebg exchangeSubviewAtIndex:purple withSubviewAtIndex:white]; 
[[whitebg layer] addAnimation:animation forKey:@"page curl"]; 

如果是,那么我怎样才能以另一种方式获得相同的结果?

+5

你是否认为他们会拒绝这段代码是有原因的? – Stormenet 2011-04-30 07:59:28

+0

除非这些动画类型是私有类型,否则可能不是。你为什么不使用相应的系统常量? – 2011-04-30 08:04:03

+0

'animation.fillMode = kCAFillModeForwards; animation.endProgress = 0.7;' – user732184 2011-04-30 08:19:05

回答

1

页面卷曲效果(animation.type = @"pageCurl";)是私人的,未公开的效果。因此您有可能会拒绝您的申请。

This blog has it about it and also shows App Store-safe实施类似效果的方式。