Xcode chat app, creating dynamic views - a little

2019-08-23 21:45发布

问题:

Am just about to start doing an iphone application which is supposed to have a multi user private chat. Something like facebook style, where the user has a list of friends and he can chat with them independently. I just need a little direction here

  1. If i have a list of users, let's say i create individual views for the chat, how can I handle these views? If jim is chatting with dick and jane, there should be 2 views, each for one chat window right? Are there any references that i can use.

  2. I am looking for references in socket programming where i can push messages to the user from the server. I have been looking but could not find anything helpful.

  3. If i try to update the user's chat window using local notifications, lets say request data every couple of seconds, will that be battery draining?

I would really like some direction here, i do not want to start something just realize its the wrong way.

Any help is highly appreciated

回答1:

  1. Those all sound like design decisions. For example, do you want to display each user's messages in a separate view? That's entirely up to you.

  2. You'll want to read about iOS Push Notifications.

  3. If you mean that you intend to poll some server for updates, then yes, that will use a lot of battery. This is exactly the sort of situation that the push notification system was created to help you avoid.