Swift giving Optional(3) instead of 3 for .toInt

前端 未结 3 1045
迷失自我
迷失自我 2021-01-29 13:51

Trying to pull a number from a Field and keep getting Optional(number) instead of the number

@IBOutlet weak var years: UITextField!

@IBAction func calculateYear         


        
3条回答
  •  遥遥无期
    2021-01-29 14:24

    I also found forced unwrapping by changing a to a! worked as well. thanks to all who tried to help.

提交回复
热议问题