Swift - 简单动画,但需要长时间保持 - 为什么不默认点按?

时间:2015-06-07 06:35:48

标签: ios uitableview swift animation

这就像我预期的那样,但我不能只是点击它。在它触发之前我必须保持它约3秒钟。我想也许这是表格单元格的一个问题,所以我也在寻找它。

我将补充一点,我使用标记的UIButton测试并触发它没有任何问题。 这个小组的任何想法?我刚刚丢失了表和indexPath的范围,没有返回所以....

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

    self.animateIN()

    // set the data into the views

    self.detailNoteDateLabel.text = self.arrayDates[indexPath.row]
    self.detailNoteTextField.text = self.arrayTitles[indexPath.row]
    self.detailNoteTextView.text = self.arrayBody[indexPath.row]
    self.scrollView.scrollEnabled = false


}

func animateIN() {
    //animate the box that shows the note and make it editable
    UIView.animateWithDuration(0.7, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0, options: UIViewAnimationOptions.CurveEaseOut, animations: {
        //        UIView.animateWithDuration(0.7, delay: 0, options: UIViewAnimationOptions.CurveEaseOut, animations: {
        // turn on the dimView/blur
        self.dimView.alpha = 0.7

        //move the view into view
        self.animatedTopConstraint.constant = 35
        self.view.layoutIfNeeded()

        //Fade Into View
        self.detailNotesView.alpha = 1

        }, completion: nil)

}

1 个答案:

答案 0 :(得分:0)

尝试将其添加到tableView类中的viewDidLoad:

self.tableView.delaysContentTouches = false