Hello,
I have now tried to subclass BackendlessUser in 7 different ways, and it seems that this class is not intended to be subclassed?
Is there any way to subclass/extend it to make user properties easily updateable/accessible?
Thanks in advance.
Were you able to solve this? I am able to subclass my other classes, but can’t figure out how to subclass the BackendlessUser class. Any example code of a class for this in Swift would be helpful. Thanks!
Do not subclass BackendlessUser. It is a bad idea and will lead to nothing but problems. Instead use the custom properties in the BackendlessUser class.
Thanks, I decided to simply roll with the built in BackendlessUser class and it suits my needs actually; I was overthinking it
Hey Mark,
I tried subclassing the BackendlessUser but my custom fields are not updating in Data browser
We need to have ability to subclass BackendlessUser Class so that we can use it as a ‘Model’ in our project. Don’t you think it should be able to subclass since Parse also does that.
Also on setting custom property using ‘setProperty()’ method , after successful creation of user an error is returned as
fatal error: use of unimplemented initializer ‘init()’ for class
Do not subclass BackendlessUser, it will not give you the results you expect.
I have subclassed it just fine. Just calling a sharedInstance of my user class after user token is true in AppDelegate. Then checking to make sure a current user is there during init() of user class. If so, update my properties. I don’t see how this could be a problem if its done only to this extent? No overriding except init() and no change of driver class properties.