Using a base model with objectId no longer works with SwiftBackendless

Are you looking for help?

This is a support forum for reporting issues related to Backendless services. Please note that due to our support policy we cannot provide you help with debugging your code, consulting in regards to any language or third-party library usage. For this kind of questions we recommend using more appropriate forums like Stack Overflow.

In order to suggest you a quality solution, we shall usually ask you to provide the details mentioned below first. Including them into your topic right away helps us to start investigating your issue much faster.

In case you have a suggestion or an idea, the details below are not always required, though still any additional background is welcome.

Backendless Version (3.x / 5.x, Online / Managed / Pro )

Newest Online version

Client SDK (REST / Android / Objective-C / Swift / JS )

Swift

Application ID

E1004849-39AA-8FA5-FF25-93C23D13CB00

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. I create a base class that contains objectId, created, and updated
  2. I subclass this base class for my models
  3. The properties in the base class will be populated when fetching data

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.

Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the request returns a 400 error with message XXX”. Copy and paste your logs, and include any URLs.

  1. When I fetch data for a class that subclasses my base class, the base class properties always return nil.
  2. If I explicitly include the property (ie objectId) in the class, then it is populated as expected
  3. This behaviour used to work in ObjC

Reproducible Test Case

Please provide a simple code that could be run in a new clean app and reproduce the issue.

BaseClass:

@objcMembers class STBaseModel: NSObject {

public var objectId: String!

public var created: NSDate!

public var updated: NSDate?

}

Table Class:

@objcMembers class STCompany: STBaseModel {

public var name: String!

public var sheets: [STSheet]?

}

If the issue is more complex or requires configuration, please provide a link to a project on Github that reproduces the issue.

Hello,
This issue has been fixed. Please update to the Swift-SDK v5.5.2 and verify whether it works fine.

Regards,
Olha