我得到一些错误与以下方法:
原文链接:https://www.f2er.com/swift/321096.html1)如何返回screenHeight / cellCount作为第一种方法的CGFLoat?@H_403_2@
2)如何在第二种方法中使用等价的ObjC的MIN()和MAX()?@H_403_2@
func tableView(tableView: UITableView!,heightForRowAtIndexPath indexPath: NSIndexPath!) -> CGFloat { var cellCount = Int(self.tableView.numberOfRowsInSection(indexPath.section)) return screenHeight / cellCount as CGFloat } // #pragma mark - UIScrollViewDelegate func scrollViewDidScroll(scrollView: UIScrollView) { let height = CGFloat(scrollView.bounds.size.height) let position = CGFloat(MAX(scrollView.contentOffset.y,0.0)) let percent = CGFloat(MIN(position / height,1.0)) blurredImageView.alpha = percent }