Where to Delegate for StreamDelegate?

Brandon Peters <bap04e@...>


I sort of came down with "paralysis analysis" last night. I am developing a small chat app on iOS. I am going to use Foundation's InputStream, OutputStream, and StreamDelegate. I became stuck between these design choices:

  • Apply the StreamDelegate protocol to the chat view controller class.
  • Create a "network manager" singleton class, and apply the StreamDelegate to this class.

Which of these is the "best". Are there any alternatives I am not considering?

Join cocoa@apple-dev.groups.io to automatically receive all group messages.