Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeclared type 'WebsocketDelegate' #34

Closed
cupofjoakim opened this issue Nov 21, 2014 · 2 comments
Closed

Undeclared type 'WebsocketDelegate' #34

cupofjoakim opened this issue Nov 21, 2014 · 2 comments

Comments

@cupofjoakim
Copy link

Trying out starscream for the first time, but xcode is giving me trouble (6.1). On line 4 (the one that starts with 'class leadViewController') I get "Use of undeclared type 'WebsocketDelegate'".

import UIKit
import Starscream

class leadViewController: UIViewController, WebsocketDelegate {

    var socket = WebSocket(url: NSURL(scheme: "ws", host: "192.168.2.56:1337", path: "/")!)

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        socket.delegate = self
        socket.connect()
    }

    func websocketDidConnect() {
        println("websocket is connected")
    }

    func websocketDidDisconnect(error: NSError?) {
        println("websocket is disconnected: \(error!.localizedDescription)")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}
@cupofjoakim
Copy link
Author

My mistake - it should be WebSocketDelegate - not WebsocketDelegate. 💩

@daltoniam
Copy link
Owner

All good, it is actually good thing you posted the issue. It made me realize I need to update the example, so thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants