Closed brototyp closed 7 years ago
Yeah, moving all that stuff, including the extensions from UIApplication, to a seperate class sounds reasonable. What do you think about "AppContext" as name for this class?
I am not sure if I would move all those methods into one class. If you want to do that i would name it just Context
because the device platform doesn't really have anything to do with the Application itself. An alternative would be:
class Context {
class Application {}
class Device {}
}
... with all methods inside are class methods. This way everything is the same (the Context), is different (Device, Application) and is still easily accessible (Context.Application.version or Context.Device.platform).
That's a good idea.
An extension to return:
Discussion: Is an extension the best idea? There might be conflicts with the main application in which the piwik-sdk is used. I guess it is better to use a separate class.