ios - 求 oc goto语句的正确姿势,现在goto 的调用在条件以内,但是实际情况是条件没满足也调用了,什么情况?谢谢
天蓬老师
天蓬老师 2017-04-18 09:40:15
0
1
1023

求 oc goto语句的正确姿势,现在goto 的调用在条件以内,但是实际情况是条件没满足也调用了,什么情况?谢谢

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
小葫芦

Follow the normal program execution sequence, after self.collectionView.alpha = 1, continue to execute the following code. goto just helps you jump to this sentence in advance, it does not mean that when the normal sequence execution reaches this point, the execution of the code included in this goto will be skipped.
It can be roughly understood that if there is no break in the switch, the following code will continue to be executed.

If it were me, I would write it as

if(pangestureRecongnizer.state == UIGestureRecognizerStateEnded && offsetY<=70 && offsetY >= -70 ){

self.collectionView.alpha = 1;

}else{

collectionViewHidden

}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template