如何使用Swift3从GitHub获取标签

时间:2017-03-15 02:37:43

标签: ios swift github alamofire

我想知道如何从用户设置中获取标签。我知道如何将选定的标签发布到用户的存储库。

 let authToken = GithubAPIManager.sharedInstance.OAuthToken
    let repo = newIssue.repo!.name!
    let repoOwner = newIssue.repo!.ownerLogin!


    let URL = Foundation.URL(string: "https://api.github.com/repos/\(repoOwner)/\(repo)/labels")!

    print("Issue URL ---->", URL)

    Alamofire.request(URL, method: .get, parameters: getParameters, encoding: JSONEncoding.default).responseJSON {

        (response) in

        guard let object = response.result.value else {
            print(response.result.error!)
            completionHandler(.failed)
            return
        }

        completionHandler(.success)
        print(object)

    }

0 个答案:

没有答案