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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -