What is the reason behind not importing Alamofire in my project?

前端 未结 3 1939
甜味超标
甜味超标 2020-12-11 13:53

I am making a demo of Alamofire using cocoa-pods.I am referring the tutorial \"https://github.com/Alamofire/Alamofire\". I tried both manual and by sample procedure .But, w

相关标签:
3条回答
  • 2020-12-11 13:54

    xcode need time to add Alamofire in to your project. My suggestion:

    Press Command + Shift + R to rebuild project.

    0 讨论(0)
  • 2020-12-11 13:56
    1. Open Terminal and cd to your project folder.
    2. Create Podfile and add the code from https://github.com/Alamofire/Alamofire
    3. In Terminal, run

      pod install
      
    4. Close the project and open the newly created workspace: projectName.xcworkspace.

    5. Run and build the project once.

    Now it should be able to import.

    0 讨论(0)
  • 2020-12-11 13:59

    When there is a mismatching version in your 'Podfile' against your Xcode Version, it would cause this issue. For example:

    My Xcode Version is 9.2 (see below)

    Therefore my Podfile will need to include 9.2 in the platform section (see below on line 2)

    After that, go back to your Terminal and recreate the '.xcworkspace' file by executing in the project folder:

    pod install
    

    Finally, open your '.xcworkspace' file in Xcode and click Build.

    This should resolve the issue

    0 讨论(0)
提交回复
热议问题