首页 > 解决方案 > 在操场上使用日期时“执行被中断”。谁能解释一下?

问题描述

当我在 XCode-beta 11 的 Playground 中使用类型为 Date 的属性时,出现错误:“执行被中断”。(在 Xcode 10 中一切都很好)

截屏

Xcode 11.0 测试版 3 (11M362v)

import Foundation

class Singleton {
  static let shared = Singleton()
  private init() {}

  let date = Date()
}

let singleton = Singleton.shared // Error here (when instance created)
print("DATE:", singleton.date)

标签: swiftxcodeswift-playground

解决方案


推荐阅读