0

I have imported CallKit framework as optional only. But import CallKit crashes while running on iOS 9 at launch. But works perfectly on iOS 10. It worked fine in XCode 8 beta 6 but this issue is happening only on XCode 8. The code is in Swift 3.

Any help is much appreciated.

  • If you have not done so already, please [file a Radar](http://bugreport.apple.com) with Apple about this, including the crash report file generated and all relevant details about the Xcode and SDK version you are running on, and ideally a small Xcode project which demonstrates the issue – Stuart M Sep 22 '16 at 18:01

2 Answers2

1

CallKit API is only for iOS 10.0+. It won't work for iOS 9.0. Use a condition for iOS version 9.0 and 10.0 to avoid the crash.

Reference : https://developer.apple.com/reference/callkit?language=objc

Jamshed Alam
  • 12,424
  • 5
  • 26
  • 49
1

There is/was a bug in Swift 3 language that wrongly links module libraries github pull request, that is fixed now, but the fix is not yet implemented in XCode, not even in beta.

You could get latest swift toolchain build from link and install it to XCode to try and see the fix, but the app would not be approved for Appstore as it's stated here

apple approval swift version

You got two solutions;

  • wait for apple to release XCode with new version of swift 3.0.2+
  • or revert your code back to swift 2, where it works, with "Use Legacy Swift Language Version" flag in Build Settings Build Settings -> Use Legacy Swift Language Version

If you choose to revert back to swift 2, brace yourself with a lot of patience :D

Matija Kraljic
  • 136
  • 1
  • 4