tidwall / SwiftWebSocket

Fast Websockets in Swift for iOS and OSX
MIT License
1.53k stars 244 forks source link

Add `required` to designated initializers #130

Open xareelee opened 6 years ago

xareelee commented 6 years ago

This fix is for swift 4.

Add the keyword required to designated initializers for protocol extension.

I found that @danthorpe forked this repo to add protocols to the class WebSocket, and the protocol could be extracted out of this repo.

https://github.com/danthorpe/SwiftWebSocket/blob/SWS-9_websockettype_protocol/Source/WebSocket.swift#L1677

To make a generic type instantiatable, we need to make the designated initializers marked with the keyword required.