Cov txheej txheem:

Kuv yuav ntxiv Cocoapods li cas rau qhov project uas twb muaj lawm?
Kuv yuav ntxiv Cocoapods li cas rau qhov project uas twb muaj lawm?

Video: Kuv yuav ntxiv Cocoapods li cas rau qhov project uas twb muaj lawm?

Video: Kuv yuav ntxiv Cocoapods li cas rau qhov project uas twb muaj lawm?
Video: Yuav txiv twm koj neej thiaj tsis kawg. 10/11/2017 2024, Hlis ntuj nqeg
Anonim

Txhawm rau tsim ib txoj haujlwm tshiab nrog CocoaPods, ua raws li cov kauj ruam yooj yim no:

  1. Tsim ib qho tshiab qhov project hauv Xcode raws li koj xav tau.
  2. Qhib lub qhov rais davhlau ya nyob twg, thiab $ cd rau hauv koj li qhov project phau ntawv.
  3. Tsim Podfile. Qhov no tuaj yeem ua tau los ntawm kev khiav $ pod ib init.
  4. Qhib koj Podfile.

Ib yam li ntawd, nws tau nug, Kuv yuav nruab POD cov ntaub ntawv li cas hauv qhov project?

Cov kauj ruam yooj yim rau nruab pod ntaub ntawv:

  1. Qhib lub davhlau ya nyob twg 2.
  2. teeb koj qhov project txoj kev ntawm lub davhlau ya nyob twg.
  3. command: pod ib.
  4. mus rau pod ntaub ntawv ntawm koj qhov project thiab ntxiv pod uas koj xav kom nruab.
  5. ntxiv rau hauv cov ntaub ntawv pod: pod 'AFNetworking', '~> 3.0.
  6. Hais kom ua: Pod install.
  7. Kaw qhov project ntawm Xcode.
  8. qhib koj qhov Project los ntawm terminals.

Kuj Paub, Kuv yuav ntxiv Alamofire rau Swift project li cas? Alamofire yog HTTP networking tsev qiv ntawv sau rau hauv Swift.

Kev tuav tes

  1. Qhib Terminal, cd rau hauv koj qhov project directory saum toj kawg nkaus, thiab khiav cov lus txib hauv qab no "yog tias" koj qhov project tsis tau pib ua git repository:
  2. Qhib Alamofire nplaub tshev tshiab, thiab rub lub Alamofire.
  3. Xaiv lub Alamofire.

Tsis tas li ntawd, kuv yuav nruab pods li cas?

2 Teb

  1. Qhib Terminal.
  2. Yog tias koj tsis tau ua li ntawd, khiav cov lus txib no: sudo lub pov haum nruab cocoapods.
  3. Nrhiav qhov project directory hauv Finder.
  4. Ntaus cd rau hauv lub davhlau ya nyob twg, ua raws li qhov chaw.
  5. Luag thiab tso qhov project directory rau hauv lub qhov rais terminal.
  6. Nias rov.
  7. Tam sim no ntaus pod install.

Kuv yuav kho Podfile li cas?

  1. siv nano los ntawm lub davhlau ya nyob twg, lossis tsuas yog rub thiab tso rau hauv cov ntawv nyeem zoo li sublime - jose920405 Lub Xya Hli 11 '16 ntawm 12: 41.
  2. Txoj nyem rau ntawm qhov ntawd thiab xaiv Qhib Nrog kev xaiv uas koj tuaj yeem qhib koj lub Podfile hauv TextEditor lossis TextWrangler. -

Pom zoo: