I'm getting this error: "Cannot use instance member 'server' within property initializer; property initializers run before 'self's available" in this line of my code
EDIT
import UIKit
import ChinoOSXLibrary
class LoginCL: UIViewController {
@IBOutlet weak var emailField: UITextField!
@IBOutlet weak var passField: UITextField!
var loggedUser: LoggedUser!
var customerId = "xxx"
var customerKey = "xxx"
var server = "https://api.test.chino.io/v1"
var chino = ChinoAPI.init(hostUrl: server, customerId: customerId, customerKey: customerKey)
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
how i can solve it? The error is at this line
var chino = ChinoAPI.init(hostUrl: server, customerId: customerId, customerKey: customerKey)