【发布时间】:2013-06-19 16:25:14
【问题描述】:
我正在关注一个教程,我对这行代码有点困惑......
sideView.frame = CGRectMake(gesture.direction == UISwipeGestureRecognizerDirectionRight ? -swipedCell.frame.size.width : swipedCell.frame.size.width, swipedCell.frame.origin.y, swipedCell.frame.size.width, swipedCell.frame.size.height);
gesture.direction == UISwipeGestureRecognizerDirectionRight ? -swipedCell.frame.size.width : 是什么意思?
在我的经验中我从未见过它。 == 和 ? - 和 : 在此声明中是什么意思?或者你能解释一下整个事情吗?如果我左右滑动,框架会变成什么?
非常感谢。
【问题讨论】:
-
@Matthias,但我不只是在问这个问题,我想知道它的方向以及这条线的含义。
标签: ios objective-c frame gesture cgrectmake