Swift 项目中的 Restkit [英] Restkit in Swift Project

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

问题描述

我已将 RestKit 导入到我的 swift 项目中.但是我无法在我的 swift 文件中导入 Restkit.h 文件.谁能告诉我要遵循的步骤,以便我可以将 Restkit.h 文件导入我的 swift 文件?RestKit 有 Swift 语言版本吗?

I have imported the RestKit to my swift project. But I'am not able to import the Restkit.h file in my swift file. Can anyone please tell me the steps to follow so that I can import the Restkit.h file to my swift file? Is RestKit available in swift language?

推荐答案

当然可以使用.

在您的项目中创建桥接头文件.将其命名为 [your-project-name]-Bridging-Header.h.

Create bridging header file inside your project. Name it as [your-project-name]-Bridging-Header.h.

RestKit.h 头文件导入到您之前创建的桥接头文件中,以便与该文件集成.https://github.com/RestKit/RestKit/blob/development/代码/RestKit.h

Import RestKit.h header into your bridging header file that you created previous one to integrate with this file. https://github.com/RestKit/RestKit/blob/development/Code/RestKit.h

[您的项目名称]-Bridging-Header.h

#import "RestKit.h"

不要忘记将 RestKit 项目文件夹复制到您的项目文件夹中.

Don't forget to copy RestKit project folder into your project folder.

参考:

http://blog.revivalx.com/2014/12/30/bridging-between-swift-and-objective-c-in-the-same-project/

https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

这篇关于Swift 项目中的 Restkit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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