Google App Indexing无法解决Swift问题? [英] Google App Indexing not resolving for Swift?

查看:158
本文介绍了Google App Indexing无法解决Swift问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Google App Indexing 整合到我的iOS / Swift中应用程序。我通过CocoaPods 安装了。问题是它没有解决任何谷歌的代码。这就是我得到的:

I'm trying to integrate Google App Indexing into my iOS / Swift app. I installed it via CocoaPods. The problem is it's not resolving any of Google's code. Here's what I got:

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

编译错误说:使用未解析的标识符'GSDDeepLink'。我尝试添加导入GoogleAppIndexing 甚至导入GSDDeepLink ,但它说:没有这样的模块' GoogleAppIndexing'。任何想法或任何人都可以使用Swift?

The compile error says: Use of unresolved identifier 'GSDDeepLink'. I tried adding import GoogleAppIndexing and even import GSDDeepLink, but it says: no such module 'GoogleAppIndexing'. Any ideas or anyone got this to work with Swift?

推荐答案

在支持文件下,应该有一个以 - 结尾的文件转职Header.h。你想在那里做Objective-C import语句:

under supporting files, there should be a file that ends with "-Bridging-Header.h." You want to do the Objective-C import statement there:

#import <GoogleAppIndexing/GoogleAppIndexing.h>

这篇关于Google App Indexing无法解决Swift问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆