Today I'm a little nasty.
All of our view controllers inherit from two different parent view controllers, say, XXXViewController and YYYViewController. XXXViewController, in turn, inherits from TrackedUIViewController , which is the class specified in the Google Analytics SDK, so all your view controllers can inherit it and easily track it.
YYYViewController, however, inherits from another type of view controller. Ah, and this is open source, which I really don't want to change.
What is the problem? We cannot track any of the YYYViewController because we cannot access the methods specified in the TrackedViewController because they are private.
I donβt want to change the source specified in the Google Analytics SDK. So what have I done? Create a category that provides these methods to avoid a compilation error.
The obvious downside to this is that the GA source code may change, but it will be pretty easy to spot.
I was wondering what other problems I might run into doing this, and if you guys can come up with a better approach.
thanks
source share