没有这样的模块Almofire

时间:2015-09-02 03:03:21

标签: swift alamofire

我下载了Alamofire并将Alamofire.xcodeproj添加到我的项目中。然后我将它添加到嵌入式库并构建阶段目标依赖项。一切看起来都不错,但它在Import Alamofire上给了我Alamofire模块错误。

我正在使用Swift 2.0,仅供参考。我错过了什么?

提前感谢您的帮助,

3 个答案:

答案 0 :(得分:0)

我能够通过将其升级到最新的XCODE来解决这个问题。

答案 1 :(得分:0)

试试这个。

对于Swift 2.0,无需在您的xcode中添加Alamofire.xcodeproj。只需从https://github.com/Alamofire复制并粘贴源文件夹即可。

答案 2 :(得分:-1)

试试此链接。

我最近在我的项目中解决了这个问题。这段代码运作良好。 请尝试以下链接:http://www.programminghub.us/2017/12/no-such-module-almofire.html


    import Alamofire

    let urlString = "" //your url
    Alamofire.request(urlString, method: .post, parameters: 
    ["": ""],
    encoding: JSONEncoding.default, headers: ["": ""]).responseJSON {
    response in
          print(response)
          switch response.result {
          case .success:
               print(response.value!)
               break
          case .failure(let error):
                print(error)
          }
    }