Posts

Post marked as solved
1 Replies
261 Views
If I use the following code, the project works normal. let listRequest = FetchRequest<ReminderList>(entity: ReminderList.entity(), sortDescriptors: [NSSortDescriptor(key: "title", ascending: true)]) var lists: FetchedResults<ReminderList>  {         return listRequest.wrappedValue     } But if I put lists variable in init() method (the following), the data not load. I don't know why. let listRequest = FetchRequest<ReminderList>(entity: ReminderList.entity(), sortDescriptors: [NSSortDescriptor(key: "title", ascending: true)]) var lists: FetchResults<ReminderList> init() { self.lists = listRequest.wrappedValue }
Posted
by Edwardai.
Last updated
.
Post not yet marked as solved
3 Replies
916 Views
Newest Xcode 12(12A7209) updating from App Store, catalina 10.15.6 The following simple codes could not run normally in playground in Xcode. Get the following message: error: Execution was interrupted, reason: signal SIGABRT. import Foundation import SwiftUI import PlaygroundSupport struct ContentView: View {     let appleProducts: Array&lt;String&gt; = ["iPod", "iPhone", "Macbook", "Macbook Pro", "Mac Pro"]     var body: some View {         ScrollView(.horizontal, showsIndicators: false) {             HStack {                 ForEach(0..&lt;5) {                     Text("\($0)")                 }             }         }     } } PlaygroundPage.current.setLiveView(ContentView())
Posted
by Edwardai.
Last updated
.
Post not yet marked as solved
0 Replies
354 Views
import UIKitimport ARKitimport SceneKitimport PlaygroundSupportclass ViewController: UIViewController, ARSCNViewDelegate{ var sceneView = ARSCNView() override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = .blue sceneView.delegate = self sceneView = ARSCNView(frame: self.view.frame) self.view.addSubview(sceneView) // The playground promt errors here sceneView.backgroundColor = UIColor.lightText let scnSphere = SCNSphere(radius: 0.05) let sphereMaterial = SCNMaterial() sphereMaterial.diffuse.contents = UIColor.blue scnSphere.materials = [sphereMaterial] let sphereNode = SCNNode() sphereNode.geometry = scnSphere sphereNode.position = SCNVector3(0, 1, 0) sceneView.scene.rootNode.addChildNode(sphereNode) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) let configuration = ARWorldTrackingConfiguration() sceneView.session.run(configuration) }}PlaygroundPage.current.liveView = ViewController()
Posted
by Edwardai.
Last updated
.