Google App Indexing无法解决Swift问题?

时间:2015-07-20 10:58:59

标签: ios swift ios8 cocoapods google-app-indexing

我试图将Google App Indexing集成到我的iOS / Swift应用中。我安装了它via CocoaPods。问题是它没有解决任何谷歌的代码。这就是我得到的:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
    var sanitizedURL = GSDDeepLink.handleDeepLink(url)
    return true
}

编译错误说:Use of unresolved identifier 'GSDDeepLink'。我尝试添加import GoogleAppIndexing甚至import GSDDeepLink,但它说:no such module 'GoogleAppIndexing'。任何想法或任何人都可以使用Swift吗?

1 个答案:

答案 0 :(得分:0)

在支持文件下,应该有一个以" -Bridging-Header.h结尾的文件。"您想在那里执行Objective-C import语句:

#import <GoogleAppIndexing/GoogleAppIndexing.h>