Skip to content

Conversation

@codecaffeine
Copy link
Contributor

SocketRocket is a dependency, but not part of the public interface to Pusher. If you build an app only using the OS X framework (as opposed to CocoaPods), you’ll get an error saying “SRWebSocket.h cannot be found”.

Since SRWebSocket.h is already imported in the .m file, we can just declare the protocol there. This may break really old versions of Xcode, but anything using Xcode 5 or 6 should be fine (probably 4.3 or 4.2 as well).

SocketRocket is a dependency, but not part of the public interface to
Pusher. If you build an app using the OS X framework, you’ll get 
an error saying SRWebSocket cannot be found.
@lukeredpath
Copy link
Contributor

+1 for better encapsulation but could you also fix the unit tests. Thanks.

Instead of calling the SocketRocket delegate methods directly, perform 
the socketID and state functions that would normally be performed by 
the SocketRocket delegate manually.
@codecaffeine
Copy link
Contributor Author

Whoops, sorry about that. As noted in the commit message, instead of calling the SocketRocket delegate methods directly, it’s now handling and reporting the socketID and state manually. I’m not sure if it’s the best solution, but I couldn’t see any other way without exposing the SocketRocket requirements publicly.

@lukeredpath
Copy link
Contributor

I'm not a fan of this solution as its now duplicating logic in the superclass.

Can you not just declare the superclass as conforming to the socket delegate protocol in a class extension in the mock connection header?

Rather than duplicating functionality.
@codecaffeine
Copy link
Contributor Author

Ugh, you’re totally right, that’s a much better solution. Sorry, I didn’t mean to complicate things.

lukeredpath added a commit that referenced this pull request Oct 29, 2014
Remove Public SRWebSocket.h Import
@lukeredpath lukeredpath merged commit 63c1e06 into pusher:master Oct 29, 2014
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

Successfully merging this pull request may close these issues.

2 participants