Swift和AFNetworking集成 [英] Swift and AFNetworking integration

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

问题描述

现在, swift 是开发iOS应用的新语言。

Now as swift is the new language to develop iOS apps.

我们如何使用 NSURLSession AFNetworking
集成将是更好的选择? ?

How can we integrate with the AFNetworking or using NSURLSession will be a better option ???

请帮帮我..

推荐答案

你必须将AFNetworking添加到您的swift项目

You have to add AFNetworking to your swift project

在构建设置 - >定义模块设置为是

In Build Settings -> Defines Module set to Yes

在构建设置中 - > Swift编译器 - > Objective-C桥接文件设置桥接文件的名称'ProjectName-Bridging-Header.h'例如

In Build Settings -> Swift compiler -> Objective-C bridging file set the name of bridging file 'ProjectName-Bridging-Header.h' for example

在ProjectName-Bridging-Header.h中写:

In ProjectName-Bridging-Header.h write:

#import "AFNetworking.h"

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

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