Я получаю эту ошибку, когда пытаюсь запустить свою игровую площадку в Xcode:
error: Execution was interrupted, reason: signal SIGABRT.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
Это мой код игровой площадки:
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white
let titleLabel = UILabel()
titleLabel.frame = CGRect(x: 150, y: 200, width: 200, height: 20)
titleLabel.text = "Title"
titleLabel.textColor = .black
let subtitleLabel = UILabel()
subtitleLabel.text = "Subtitle"
subtitleLabel.textColor = .gray
subtitleLabel.frame = CGRect(x: 150, y: 200, width: 200, height: 20)
NSLayoutConstraint.activate([
titleLabel.bottomAnchor.constraint(equalToSystemSpacingBelow: subtitleLabel.topAnchor, multiplier: 10)
])
view.addSubview(subtitleLabel)
view.addSubview(titleLabel)
self.view = view
}
}
PlaygroundPage.current.liveView = MyViewController()
Как исправить эту ошибку? Это ошибка в Xcode? Или что-то не так с моим кодом?