Jack Robson Jack Robson - 4 months ago 21
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?


Try this instead:

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