self in the closures in login is nil. The ECP client is a variable within the viewDidLoad method of the example's view controller, so it falls out of scope after login is called and before the request callbacks run. If client is a property of the view controller and thus kept around for the view controller's lifetime it works.
Since there's only one method on the class, maybe dispose of the class altogether and just make it a function?
self
in the closures inlogin
is nil. The ECP client is a variable within theviewDidLoad
method of the example's view controller, so it falls out of scope after login is called and before the request callbacks run. If client is a property of the view controller and thus kept around for the view controller's lifetime it works.Since there's only one method on the class, maybe dispose of the class altogether and just make it a function?