Reputation: 11193
I'm trying to use aws cognito with swift, by installing it using pod. However after i've pod installed:
pod 'AWSCognito'
pod 'AWSCore'
i keep getting following errors could not build Objective-C module 'AWSCore'
on
import AWSCore
import AWSCognito
and inside the aws cognito pod i get following error include of non-modular header inside framework module 'AWSCore'
on
#import <sqlite3.h>
i've tried setting non-moduler headers to yes and deleted derrived data, but it still can't build?
Upvotes: 2
Views: 431
Reputation: 2505
You should create the bridging header file to use Objective c code in swift. To create the bridging header file click file -> New -> File -> iOS -> header file. Then name your bridging header file as following pattern “YourProjectName-Bridging-Header.h”. Then add following in your header file to access objective c frameworks.
#import <AWSCore/AWSCore.h>
#import <AWSCognito/AWSCognito.h>
Then configure your “YourProjectName-Bridging-Header.h” in build setting,
Select your project target -> Build settings -> Swift compiler - general -> Objective c bridging header -> Add your bridging header file with complete path.(Or Simply do click option-key + drag)
Upvotes: 3