我想尝试通过CLI上的swift库通过API获取子文件。我正在使用Alamofire库,但无法理解如何导入Swift库。
也许在导入(构建?链接?)之前需要执行一些任务,但是我找不到如何记录文档的方法。您能教我该怎么做吗?
$ swift getAPI.swift
getAPI.swift:1:8: error: no such module 'Alamofire'
import Alamofire
^
Run Code Online (Sandbox Code Playgroud)
import Alamofire
func getArticles(){
Alamofire.request(.GET, "https://qiita.com/api/v2/items")
.responseJSON { response in
print(response.result.value )
}
}
getArticles()
Run Code Online (Sandbox Code Playgroud)