ios - How to architect 'State Controller' objects being delegates of shared services -
i have uiviewcontroller conforms 'massive view controller' anti-pattern. trying break functionality out 'state controller' objects act controllers each state viewcontroller might in. question regarding services multiple states might need listen to. example 1 state might 'videorecordingstate' , has reference 'filesystem' object owned uiviewcontroller. when recording stops 'videorecordingstate' replaced 'videoreviewstate'. both states interested in listening 'filewritecompleted' event 'filesystem', , file write started 1 state might complete after has been replaced state. so, each state become delegate of 'service' object , swaps out when state changes, or make more sense uiviewcontroller delegate of service , pass notification on current state? or whole design plain wrong begin with?
Comments
Post a Comment