I'm playing with HomeKit, and I'm trying to add a new home. This is my code:
func addHome()
{
homeManager.addHomeWithName("My House", completionHandler:
{ (error: NSError!, home: HMHome!) in
if error
{
NSLog("%@", error)
}
})
}
This gives a compiler error:
Cannot convert the expression's type 'Void' to type 'String!'
I've tried specifying a return type of Void
:
...
{ (error: NSError!, home: HMHome!) -> Void in
...
to no avail. Does anyone have any ideas how to fix this? Passing nil
to the completion handler fixes the error, but of course I want to do something on completion.