陈斌彬的技术博客

Stay foolish,stay hungry

集成SwiftyJSON

1.You can use Carthage to install SwiftyJSON by adding it to your Cartfile:

github "SwiftyJSON/SwiftyJSON"

img

2.Run carthage update. This will fetch dependencies into a Carthage/Checkouts folder, then build each one.

On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following contents:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”, e.g.:

$(SRCROOT)/Carthage/Build/iOS/SwiftyJSON.framework

img

项目目录结构

img

项目文件夹

img