Hi, I am developing a FEED in swift but I’m having a problem with application performance . so I set up the test below.
CODE:
import UIKit
import MapKit
import CoreLocation
var VALUES : Array = [""]
var PROMOCAO = [String]
var ITEM = String
var userIMAGE: [UIImage] = []
var postIMAGE: [UIImage] = []
class ViewControllerTeste: UIViewController {
var url = NSURL()
var data = NSData()
let backendless = Backendless.sharedInstance()
let query = BackendlessDataQuery()
@IBAction func BT_GETDATA(sender: AnyObject) {
print("----------------------------------------------------")
print(“START: (timeStamp())”)
print("----------------------------------------------------")
VALUES.removeAll()
PROMOCAO.removeAll()
let dados = self.backendless.persistenceService.of(postApp.ofClass()).find(query)
let itens = dados.getCurrentPage()
print("----------------------------------------------------")
print("----------------------------------------------------")
print(“count: (itens.count)”)
print("----------------------------------------------------")
print("-- list ----------------------------------------")
print("----------------------------------------------------")
for item in itens as! [postApp] {
VALUES.append(String(item.objectId!))
ITEM.removeAll()
ITEM.append(item.objectId!)
ITEM.append(item.postFbId!)
ITEM.append(item.postAddress!)
print(item.objectId!)
print(item.postFbId!)
print(item.postAddress!)
PROMOCAO.append(ITEM)
}
print("----------------------------------------------------")
print(“END: (timeStamp())”)
print("----------------------------------------------------")
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
func timeStamp() -> String {
return String(NSDateFormatter.localizedStringFromDate(NSDate(), dateStyle: .MediumStyle, timeStyle: .LongStyle))
}
}
RESULT (using wi- fi 100MB)
WIFI - test 1
START: 6 de jun de 2016 14:47:58 BRT
count: 1
– list ----------------------------------------
B9591BC3-2749-D717-FF03-4AE35FDFB900
10156868518855567
Rua das Oliveiras 1–35 Santo André
END: 6 de jun de 2016 14:48:00 BRT
WIFI - test 2
START: 6 de jun de 2016 14:49:46 BRT
count: 1
– list ----------------------------------------
B9591BC3-2749-D717-FF03-4AE35FDFB900
10156868518855567
Rua das Oliveiras 1–35 Santo André
END: 6 de jun de 2016 14:49:49 BRT
WIFI - test 2
START: 6 de jun de 2016 14:50:25 BRT
count: 1
– list ----------------------------------------
B9591BC3-2749-D717-FF03-4AE35FDFB900
10156868518855567
Rua das Oliveiras 1–35 Santo André
END: 6 de jun de 2016 14:50:27 BRT
believe to be very little information for a long time to complete the request. I wonder if I am missing or if you have any suggestions to improve application performance
tks