2017-11-03 1 views
0

Alamofire V4를 신속한 3 프로젝트에 추가하고 싶습니다. 다른 일반 라이브러리와 마찬가지로 manully를 추가하고 싶습니다. 단순히 프로젝트에 소스 코드를 추가하십시오. 수동으로 Alamofire를 수동으로 추가하는 방법, 나는 그것을 framwork/target dependency로 추가하고 싶지 않습니다.수동으로 Alamofire를 신속하게 추가 3

+0

이 답변으로 시도해 볼 수 있습니까? https://stackoverflow.com/questions/31706589/cannot-add-alamofire-to-swift-project –

답변

0

POD 와도 쉽게 통합 할 수 있습니다.

및 API를 호출하고 응답을 처리하는 간단한 코드.

import UIKit 

class ViewController: UIViewController { 

    override func viewDidLoad() { 
     super.viewDidLoad() 

     self.API_Formation_Function("[email protected]", password: "password12345") 
    } 


    func API_Formation_Function(_ userName : String , password : String) { 

     EMReqeustManager.sharedInstance.apiLogin(userName, password: password) { 
      (feedResponse) -> Void in 

       // Show your progress HUD here 

      if let downloadError = feedResponse.error{ 

       // Hide progress HUD here and show error if comes 

      } else { 
       if let dictionary = feedResponse.responseDict as? Dictionary<String, AnyObject>{ 

        // Hide progress HUD here and show response 

        let responseModel = EMResponseModel.init(jsonDict: dictionary) 

        print(responseModel) 

       } 
      } 
     } 

    } 

    override func didReceiveMemoryWarning() { 
     super.didReceiveMemoryWarning() 
     // Dispose of any resources that can be recreated. 
    } 
} 

Refer

0

당신이 CocoaPods 자동으로 그것을하지 않으려는 이유는 특별한 이유가 있습니까? CocoaPods를 설치하면 아이디어가 사라집니다. 일단 당신이 그것을 설치하면, 당신의 addons를 업데이트하고 관리하기위한 그것의 경이로운. 다음은 CocoaPod를 설치하는 방법에 대한 비디오 튜토리얼입니다.

https://www.youtube.com/watch?v=iEAjvNRdZa0&t=2s

은 자신에게 호의를 수행하고 설치 시간이 걸릴.

관련 문제