I have a very simple NSViewController , which hits an API using a WeatherFetcher class. It passes a completion handler as a parameter, so that the
NSViewController
WeatherFetcher
You don't have access to the instance scope when initialising properties, you can only access the static context.
Try this:
var currentWeatherCallback: Weather? -> Void { return { (weather: Weather?) in self.currentTemp.stringValue = weather?.updatedTime } }