Jack Robson Jack Robson - 1 month ago 10
iOS Question

Cannot convert value of type '(TVSessionConfigurationBuilder!) -> Void' to expected argument type 'TVSessionConfigurationBuilderBlock!'

Just followed the iOS TeamViewer SDK tutorial but it won't work for me using Swift.

let sessionConfiguration : TVSessionConfiguration = TVSessionConfiguration.tvSessionConfigurationWithBlock(
{
(builder: TVSessionConfigurationBuilder!) -> Void in
builder.sessionCode = "SESSION_CODE"
})


Gives the error in the title.

Any suggestions?

Answer

Try this instead:

let sessionConfiguration = TVSessionConfiguration(block: { builder in
    builder!.sessionCode = "SESSION_CODE"            
})
Comments