草庐IT

ios - swift 的新手 : Why is the Timer not updating to the UILabel?

我正在尝试使用swift制作自定义时钟。我最初是用python编写的,但认为这将是学习一门新语言的好机会,但我对它进行了粗略的尝试。我已经阅读了很多关于使用Timer()的很好的答案,但似乎没有任何效果;它会更新一次并保持静态。到目前为止,这是我的代码:importUIKitimportFoundationclassViewController:UIViewController{@IBOutletweakvartimeLabel:UILabel!letclock=MarsTime()vartimer:Timer?overridefuncviewDidLoad(){super.viewD