Starscream: one connection for all app pages

Created on 10 Oct 2018  路  4Comments  路  Source: daltoniam/Starscream

hi guys
i'm new in IOS
can i have a something like android service in IOS to connect my websocket client in that and send event to all listeners in any page or i must have separate connection in any single page?

Most helpful comment

You can also make your own observer-listener stuff. Check out https://www.swiftbysundell.com/posts/observers-in-swift-part-2

All 4 comments

it's Third-party library, i think swift have a native solution because it's very important. it's not a idea to create and connect new connection in each page of app. is it?

Like @ollitapa mentioned you can set up one socket connection and then redirect events using RxSwift or ReactiveSwift. At least I'm doing similar stuff in Swift. You can open multiple sockets, but then it can be hard to manage that.

And please don't open new issues. Reopen old one and comment there. Thanks!

You can also make your own observer-listener stuff. Check out https://www.swiftbysundell.com/posts/observers-in-swift-part-2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NickNeedsAName picture NickNeedsAName  路  5Comments

lveselovsky picture lveselovsky  路  3Comments

adrian-niculescu picture adrian-niculescu  路  4Comments

nerzh picture nerzh  路  6Comments

Ivan411 picture Ivan411  路  3Comments