ios - Will adding multiple methods in shared singleton class cause any performance issue? -


in shared class created, methods in shared class called once view controller . need add method inside view controller class? adding methods directly inside view controller improve performance?

i know singleton instance allocated once , retain whole application, in case calling method singleton class or adding method directly inside view controller doesn't make performance difference guess!

you should keep methods separate in model class (often singleton) if these methods not belong in view controller class. way implementing mvc design pattern apply projects many reasons (read design patterns book more).

performance not have worry @ point (you hardly ever see improvement adding these methods directly view controller), code readiness , clean code practices pay off.

keep in mind view controller there mediating control between model , views, related task should in view controller code.


Comments