
hi
I'm trying to use rx.playground. I built the rxSwift-macOS successfully
but when I go to rx playground the debug area shows nothing! I tried using TryYourself.playground still
nothing, I commented out everything and just printed "hi" but nothing seems to work.
could anyone help me please?
I'm using Xcode 9.3 and macOS HighSierra.
Hi @SNThunderbolt ,
please fill issue template.
Keep it simple by think out of the box.
Create a sample project (not playground).
Declare function & variable as normal then it's work like a charm.
import RxSwift
func example(of description: String, completion: () -> ()) {
print("--- Example of: (description) ---")
completion()
}
class ViewController: UIViewController {
let one = 1
let two = 2
let three = 3
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let observable1: Observable<Int> = Observable<Int>.just(one)
let observable2 = Observable.of(one, two, three)
let observable3 = Observable.of([one, two, three])
let observable4 = Observable.from([one, two, three])
example(of: "subscribe") {
observable2.subscribe { (event) in
print(event)
if let element = event.element {
print(element)
}
}
}
}
}