31 lines
792 B
Swift
31 lines
792 B
Swift
import UIKit
|
|
|
|
public protocol NefPlaygroundLiveViewable {}
|
|
extension UIView: NefPlaygroundLiveViewable {}
|
|
extension UIViewController: NefPlaygroundLiveViewable {}
|
|
|
|
#if NOT_IN_PLAYGROUND
|
|
public enum Nef {
|
|
public enum Playground {
|
|
public static func liveView(_ view: NefPlaygroundLiveViewable) {}
|
|
public static func needsIndefiniteExecution(_ state: Bool) {}
|
|
}
|
|
}
|
|
|
|
#else
|
|
import PlaygroundSupport
|
|
|
|
public enum Nef {
|
|
public enum Playground {
|
|
public static func liveView(_ view: NefPlaygroundLiveViewable) {
|
|
PlaygroundPage.current.liveView = (view as! PlaygroundLiveViewable)
|
|
}
|
|
|
|
public static func needsIndefiniteExecution(_ state: Bool) {
|
|
PlaygroundPage.current.needsIndefiniteExecution = state
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|