Binary operator '==' cannot be applied to operands of type 'Int' and 'Bool'

Greetings. I am learning to program in Swift, working through the Develop in Swift Fundamentals Getting Started with App Development electronic book. Within the Lab — Control Flow.playground 5. App Exercise — Target Heart Rate, I am presented with two identical errors. I do not understand why the errors are being generated. Any explanatory response would be appreciated. See attached screenshot.

Answered by robnotyou in 706325022

Like the error message says, you cannot compare an Int and a Bool for equality.
Instead of

if currentHR == isInTarget {

Try

if isInTarget {

And later, use:

} else if isBelowTarget {
Accepted Answer

Like the error message says, you cannot compare an Int and a Bool for equality.
Instead of

if currentHR == isInTarget {

Try

if isInTarget {

And later, use:

} else if isBelowTarget {