Using Alamofire within a Playground

后端 未结 4 666
说谎
说谎 2020-12-15 23:17

I\'m new to iOS development and using Xcode and I\'m having trouble getting Alamofire to work within a Playground. There\'s some functionality I\'d like to test out for proo

4条回答
  •  长情又很酷
    2020-12-15 23:45

    Here is what I consider to be the simplest straight line path:

    Download and build Alamofire:

    brew install carthage
    echo "github \"Alamofire/Alamofire\"" > Cartfile
    carthage update
    

    Configure the workspace with a playground file and Alamofire.

    1. From the Carthage/Build/{iOS / OSX} directory, drag the Alamofire.framework file into your link library list: {Project Name} -> {Target Name} -> Build Phases -> Link Binary With Libraries
    2. Command-N (create file) -> {Platform} -> Source -> Playground
    3. If not already in a Workspace file, File -> Save as Workspace. To be paranoid, I close the project / workspace and (re)open the workspace.
    4. Click on the playground file created in #2, and add the import import Alamofire

提交回复
热议问题