Skip to content

Recieving response multiple times #66

@ShoaibHussan1

Description

@ShoaibHussan1

I am listening event in Viewdidload method.each time view did load get called it adds a listener and receiving response incremented by 1.Please tell me its fixture
here is my code
override func viewDidLoad() {
SocketHelper.sharedHelper().theSocket().emit("EventName", args:[jsonInput])
self.listenEventResponse()
}

func listenEventResponse(){
SocketHelper.sharedHelper().theSocket().on("EventName") { (dataArr:[AnyObject]!) -> Void in
let jsonDictionary = (dataArr as NSArray).objectAtIndex(0)
print(jsonDictionary)
// Here i get printed output multiple times each time added once more
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions