Swift throws "Cannot convert value of type


#1

I don’t know enough about swift programming to fix this error, so here i am, asking!

import UIKit
import Spark_SDK

class MyDevicesListTableViewController: UITableViewController {

var myParticeDevicesArr: [SparkDevice] = []

override func viewDidLoad() {
    super.viewDidLoad()

    // Uncomment the following line to preserve selection between presentations
    // self.clearsSelectionOnViewWillAppear = false

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem

    SparkCloud.sharedInstance().getDevices { (sparkDevices:[Any]?, error:Error?) -> Void in **//Cannot convert value of type '([Any]?, Error?) -> Void' to expected argument type '(([SparkDevice]?, Error?) -> Void)?'**
        if error != nil {
            print("Check your internet connectivity")
        }
        else {
            if let devices = sparkDevices as? [SparkDevice] {
                for device in devices {
                    self.myParticleDevicesArr.append(device)
                }
            }
        }
    }
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()