Using Quickblox.framework in a Swift Application

I am trying to connect QuickBlox.framework to a Swift application.

As I know, QuickBlox.framework is written in Objective-C. To use it in a Swift app, we must follow this guide.

What I've done:

  • Create bridge header demo-swift-Bridging-Header.h
  • Import QuickBlox here: #import <Quickblox/Quickblox.h>

and I got 28 errors:

<unknown>:0: error: ./Quickblox.framework/Headers/Core/Definitions/Consts.h:16: unknown type name 'NSString'
...
<unknown>:0: error: ./Quickblox.framework/Headers/Core/Definitions/Delegates.h:43: expected a type
...

Any ideas?

+4
source share
1 answer

You need to modify your bridge file a bit - add all the necessary frameworks

@import Foundation
@import SystemConfiguration;
@import MobileCoreServices;

#import <Quickblox/Quickblox.h>

QuickBlox Swift http://quickblox.com/blog/2014/06/building-ios-apps-with-quickblox-and-swift/

+3

Source: https://habr.com/ru/post/1544163/


All Articles