RxSwift minimal Observable.create example : <p>Currently I am trying to get RxSwift working. And I want to create a custom Observable. But I think I am doing something wrong. </p>

<p>I have distilled what I do to this minimal sample:</p>

<pre><code>import Foundation
import RxSwift

class Example
{

    let exampleObservable : Observable&lt;String&gt; = Observable.create { (observer) in
        observer.on(.Next("hello"))
        observer.on(.Completed)

        return AnonymousDisposable { }
    }

    let exampleObserver : AnyObserver&lt;String&gt;?

    func run()
    {
        self.exampleObserver = exampleObservable.subscribeNext({ (text) -&gt; Void in
            print(text)
        })  
    }

}

let ex = Example()
ex.run()
</code></pre>

<p>Is this correct? In the run method, the subscribeNext method is autocompleted that way by XCode.</p>

<p><a href="https://i.stack.imgur.com/kMKjb.png"><img src="https://i.stack.imgur.com/kMKjb.png" alt="Example"></a></p>

<p>But when I run it I get the following compilation error: </p>

<pre><code>Cannot Invoke 'substribeNext' with an argument list of type ((String) -&gt; Void)
</code></pre>
