Conversation
…ode context to/from dictionary.
|
I would like to discuss here scheme of the communication through WatchConnectivity between iOS and watchOS apps :) What I consider now is following approach (with future plans to enable editing Todos in watchOS): Create DictionaryEncoder/DictionaryDecoderThis is necessary because this is universal form for both background transfer (application context) and messaging. This means sending and receiving message data won't be used at all. Define contexts which will be sent over - WatchContext, IOSContext
Prepare storage for those contexts (NSUserDefaults)iOS and watchOS parts will both have both contexts cached locally to be able to determine what the other part has currently available. Based on that information iOS app will coordinate intervals to refresh the data. Wrap WCSessionDelegateIt might be useful to create separate session delegate which would notify its own delegate using WatchContext and IOSContext. It would be responsible for parsing and switching between messages and application context type of communication. Create manager on the side of iOS and watchOSOn each of both sides will be manager which controls the flow of communication and plans the communication ahead (refreshes the data based on time interaval) |
…rough Todos.addObserver.
No description provided.