3254523
3254523

Reputation: 3026

error - could not find an overload for '-' that accepts the supplied arguments

I'm getting an error stating could not find an overload for '-' that accepts the supplied arguments

here is my code :

    var lastContentOffset = scrollView.contentOffset.y
    if -lastContentOffset > 64 { // *could not find an overload for '-' that accepts the supplied arguments*
        //do something
    }

what am i doing wrong?

Upvotes: 0

Views: 81

Answers (1)

user2397282
user2397282

Reputation: 3818

Change it to this:

var lastContentOffset = scrollView.contentOffset.y
if (lastContentOffset * -1) > 64 {
    //do something
}

Upvotes: 1

Related Questions