Why is Optional(“Text”) - Swift

后端 未结 6 1024
我寻月下人不归
我寻月下人不归 2020-12-11 13:51

I just started with Swift. So I created a simple application with a label, button and a text field. When you click the button, the app has to change the label with the text

6条回答
  •  心在旅途
    2020-12-11 14:44

    In my case for Swift 4.x, I unwrapped by using below command for option Int? values or Optional list cont:

    \(topics?.count ?? 0 )
    

提交回复
热议问题