Cocoa - DataAbstract - TableRequestInfoV7 - Where are any Swift Examples

I am looking at the new TableRequestInfoV7 implementation in the .1561 Preview today and I still do not see any Swift examples in the DataAbstract Samples downloads. They must be located somewhere else online. Could you point me to where the Mac OSX / IOS examples would be located?

I am particularly interested in the Async table connections using DA Sql on our Delphi servers.

Thanks.
Bill Brittain

Hi,

if you are using DASQL you can continue use your code and TableRequestInfoV6.

TableRequestInfoV7 adds the dynamic order feature to usual tables

Thank you. Very good on the DASQL. But I would very much like to see how you guys at RemObjects build your Swift apps. I would like to see the best approach for creating the Async calls back to a custom Delphi server because that is what we are using. I think everyone would like to see the proper approach for these type of calls within a Swift IOS app. We have been using DataAbstract as a backend for our IOS apps for about 3 years but we always want to know the best approach. I want to take your approach and build the best template we can. Right now, we use async only on a few calls. We would like to build a generic call that we can pass in a table name and get back the result.

Thanks ahead of time. Bill Brittain

We dont have a generla take on hiw to bets use DA from Swift specifically, to be honest, because on our side we dont really use (Apple) Swift much/at all, we’re using the Elements lanuages which (incliding out Swift dialect) buiolt omn topmof the Objective-C model.

The best appropach for using DA from Swift would imho be the same as from Obj-C or Oxygene, using beginGetDataTable, with a closure, eg this is a random snippet i grabbed from one of my internal apps:

    @discardableResult func beginGetMonthlyRevenue(_ completion: (table: DADataTable?)->() ) -> DAAsyncRequest {
        return rda.beginGetDataTable("MonthlyRevenue") { (table) in
            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)) {
                let b = DABriefcase(folder: self.briefcaseFolder)
                b.addTable(table)
                b.writeBriefcase()
            }
            if let completion = completion {
                completion(table) // or do whetever you wanna do with ther data
            }
        }
    }

in Elements, you could also use await with closure-based APIs, but i dont believe Apple Swift supports that, so trailing closures (as shown here) are the cleanest option there.

This sample doesn’t use DA SQL, but you clould of course easily use the withSQL overload, if needed.

Thanks Marc, I will give it a try. We currently use the SqlLite on the Ipad and Iphones as our on device storage and just use the DA to retrieve the data originally and then use it to update back to the servers as the techs need to. We learned real quick not to try and maintain a connection and the Core Data on device works well. I am about to try the new SwiftData since we use the SwiftUI exclusively now. Will let you know what we come up with.

Consider using DA’s briefcase featyre for local data, instead.

indeed :wink:

Have not had a chance to look at it yet, but it’s on my list. But isnce it’ll be Apple Swift only, it probably wont be of much interest to me/us, aside from conceptually.