ios - Where should the true delegate of an adapted view be implemented? -


i going try , setup app can use either apple map or google map, think have this:

class applemap: mkmapview, mymapprotocol {   var delegate: mymapdelegateprotocol ... }  class googlemap: gmsmapview, mymapprotocol {   var delegate: mymapdelegateprotocol ... } 

both mkmapview , gmsmapview each have delegates. many of calls these delegates translated , passed apple/googlemap delegate, need handled uniquely (such viewforannotaion)

the question should mkmapviewdelegate , gmsmapviewdelegate implemented?

i thinking applemap , googlemap classes, figure common thing (wrapping class has delegate in adapter class), have not seen best practices documented.

you implement them independent model classes code remains encapsulated rest of application. variables these objects can live in custom mapchildviewcontroller object manages logic between these maps you. allowing reuse logic across app. how sound?


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -