cordova-plugin-iosrtc: Compilation fails with Swift 3

This is more a TODO item than a bug report.

Xcode 8 is in beta now, and with it comes Swift 3, which fails to compile the plugin, no surprise here. I plan to fix in the future (if nobody beats me to it).

There is a way to continue being able to compile the plugin with Xcode 8: got o Build Settings -> Use Legacy Swift Language Version -> Yes

This sets SWIFT_VERSION = 2.3 for Debug and Release targets.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 6
  • Comments: 25 (2 by maintainers)

Most upvoted comments

When a programming language advances faster than applications built on it, we have a problem…

Swift 3 updates branch -> stormbkk87/cordova-plugin-iosrtc

It’s a few minor versions off though, so heads up. I’ve been using it, haven’t found any bugs.

We found the problem. The hook does not get executed. However we followed the instructions exactly on multiple computers. Never executed. How could this be?

The solution to get things compiled anyways was to add

#import "Plugins/cordova-plugin-iosrtc/cordova-plugin-iosrtc-Bridging-Header.h"

to platforms/ios/[PROJECT_NAME]/Bridging-Header.h

We are in the same problem space, it may need the iosrtc swift code to be upgraded to Swift 3 - will keep you posted on what we find out (we are just a Meteor patch version behind), and using Swift 2.3, with some relatively small scale fixes to the IOSRTC swift code at the moment. We can keep you posted as to what we find

On 27/10/2016 6:18 am, menelike wrote:

Our project is based on Meteor and they moved their swift code to v3 within the last release. Since we can not use swift 2.3/3 in parallel we are stuck.

Does anyone know how to deal with this? (we need an up to date meteor)

Please test #263

Its working fine @rollsroyc3

FYI, this can be automated in cordova builds. I’m using this right now as part of my build process:

echo "SWIFT_VERSION = 2.3" |tee -a platforms/ios/cordova/*.xcconfig

Edit: Side note, the -a flag will always append to the file, if that’s not desired you may want to wrap that in a check using grep or something