Binary operator '==' cannot be applied to operands of type 'UILabel?' and 'String'

前端 未结 4 753
天涯浪人
天涯浪人 2021-01-29 16:46

Error : Binary operator \'==\' cannot be applied to operands of type \'UILabel?\' and \'String\'


import UIKit

class ViewController: UIViewController {
  let So         


        
4条回答
  •  终归单人心
    2021-01-29 17:01

    You're trying to compare two different types. To get the actual text of UILabel, you'll need hardness.text.

提交回复
热议问题