Empty class in Swift Playground gives __lldb_expr_ error
Choosing an empty class on Swift Playground will give you the error __ lldb_expr _
//: Playground - noun: a place where people can play
import UIKit
class FooBar {
}
let foo = FooBar()
See attached screenshot.
This happens in Xcode version 6.3.1 (6D1002) . I've also tried with the latest Xcode 6.4 beta 3 - Version 6.4 (6E7) - available May 11, 2015. The same error occured.
Empty classes are built seamlessly in a regular Swift project.
The error can be avoided simply by adding a dummy constant like this:
//: Playground - noun: a place where people can play
import UIKit
class FooBar {
let wibble = 10
}
let foo = FooBar()
Was surprised by this error, considering that creating an initial empty class is such a basic thing. In my case, I wanted the scroll delegate class to view the content offsets. It would seem perfectly reasonable to use a delegate without any properties.
Any ideas?
+3
source to share