Here's what it says:
error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
Here's my code:
import UIKit
import PlaygroundSupport
import AVFoundation
class ViewController: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
let view = UIView()
view.backgroundColor = UIColor.white
let label = UILabel()
label.text = ""
view.addSubview(label)
self.view = view
/
}
}
PlaygroundPage.current.liveView = ViewController() //error
in my sources folder there is one file:
import Foundation
import UIKit
extension UILabel {
func animate(newText: String) {
for everyChar in newText {
if self.text != "" {
self.text = self.text! + String(everyChar)
sleep(4)
}else {
self.text = String(everyChar)
sleep(4)
}
}
}
}
Please tell the error.
Thanks in advance
Regards