我收到错误说明 could not find an overload for '-' that accepts the supplied arguments
这是我的代码:
var lastContentOffset = scrollView.contentOffset.y
if -lastContentOffset > 64 { // *could not find an overload for '-' that accepts the supplied arguments*
//do something
}
我做错了什么?
答案 0 :(得分:1)
将其更改为:
var lastContentOffset = scrollView.contentOffset.y
if (lastContentOffset * -1) > 64 {
//do something
}