Abstract

There is a high probability that third-party libraries will be used in the project , adopt Pod Introducing a third-party library is a very efficient way , Here is a new project Pod The environment of the way , Facilitate the introduction of third-party library files in the project .

If you need a third-party library in the newly created project , The common way is through Pod To add , Facilitate the update of the third-party library later ; Another is to download the source code file of the third-party library , Add the whole to the project . Here we mainly explain the common ways , Processing process , And possible problems .

First, through Xcode Create an empty project , And then open the terminal , Enter the command to switch to the directory of the project , The home directory is ls See after command .xcodeproj file , It's the home directory :

*  ~ cd /Users/songhang/Desktop/NewProduct
* NewProduct ls
NewProduct NewProductTests
NewProduct.xcodeproj NewProductUITests
* NewProduct

And then there's creating Podfile The file , Continue typing instructions in the terminal pod init

*  NewProduct pod init

In the home directory of the project, a Podfile file , You can double-click to open the file ( If the computer has a text editor , As long as there is , It doesn't matter which one ). Then add the third-party library you need in this file

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '10.0'

use_frameworks!

target 'NewProduct' do

    pod 'Alamofire'
pod 'SwiftyJSON'
pod 'Kingfisher'
pod 'MJRefresh'
pod 'KakaJSON'
pod 'IQKeyboardManagerSwift'
pod 'WechatOpenSDK'
pod 'GoogleSignIn'
end

Be careful source 'https://github.com/CocoaPods/Specs.git' Not in the newly created file , Need to be manually added , also NewProduct This is the name of the project , Here is the name of my project , Your project needs to fill in your .

Then save it , Continue typing instructions at the terminal pod install:

*  NewProduct pod install

Then wait for the terminal to pull the remote third-party library file , If the network speed is not good , The waiting time is quite long .

After successful pull , The main directory of the project will generate Pods Outside the folder , And generate a .xcworkspace The file of . Then you need to click it to enter the engineering project .

But when a third-party Kula fails , You will only see Pods Folder , But I can't see it xcworkspace Engineering documents .

So if you want to avoid the failure of pulling a third-party library file , Result in failure to generate xcworkspace file , Then hide it for a while pod These libraries , namely

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '10.0'

use_frameworks!

target 'NewProduct' do

end

Then restart at the terminal pod install once , You can see that it is generated in the home directory xcworkspace , And you can open the project through it . Then add the third-party libraries one by one , And implement pod install To update Pods Folder .

There are different reasons for the above failure to pull the third-party library , Maybe the Internet speed 、 Maybe the library is missing and so on , You can see the error information in the terminal and do the corresponding processing .

Come here , The process of importing third-party libraries has been completed , You can continue with other steps later .

Digression

Hasty time , What you say may not be comprehensive , What problems did you encounter in the process of viewing , Leave me a message in the comment area , I will reply as soon as possible .

iOS- Start project ( Two ) More articles on introducing third-party libraries

  1. vue-cli An error is reported when a third-party library is introduced into the created project 'caller', 'calle', and 'arguments' properties may not be...

    http://blog.csdn.net/sophie_u/article/details/76223978 In the vue Introduction in mui Take the third-party library as an example : Although for vue, There are separate vue-mui The library can be used , but ...

  2. vue-cli An error is reported when a third-party library is introduced into the created project 'caller', 'calle', and 'arguments' properties may not be...

    Link to this article :https://blog.csdn.net/Sophie_U/article/details/76223978 problem : stay vue Of main.js Introduction in mui.min.js when , Report errors . Above , single ...

  3. iOS Real machine debugging is introduced into the third-party library ( Such as the alliance of friends, etc ) Compile time , An error message appears

    use Xcode 7 beta 3 In the real machine (iOS 8.3) Run the project on the Internet , It turns out that the engineering compiler is just . Look at the problem , The following error was reported : MARK: resolvent : stay building Setting Set in bitCode ...

  4. Swift How to introduce the third party library into the project

    following , Will create a Swift project , Then introduce the 3 Databases : Snappy simplify autolayout Code library Alamofire HTTP The network library ,AFNetworking The author wrote SDWebImage Image loading , ...

  5. pyinstaller How to introduce Pycharm Third party libraries in the project

    Use Pycharm As IDE Project , The referenced third-party libraries are generally placed in the directory where the project is located venv\Lib\site-packages Next , Therefore, you can use the following statement to introduce a third-party library pyinstaller -p venv\Lib\ ...

  6. vue-cli Introduce third-party plug-ins into the project

    Preface Recently, a little friend asked how to be in vue-cli Third party plug-ins or libraries are introduced into the project , For example, if you want to use jQuery Medium Ajax What about the request data ? Or I want to use Bootstrap What about the framework ? Wait for these questions , This blog will take you to learn such as ...

  7. be based on webpack Achieve more html Page development framework 7 Introduce third-party libraries, such as jquery

    One . What problem to solve 1. How to introduce a third party Library , Such as jquery etc. Two . introduce jquery Method 1. download jquery.min.js Put it in assets/lib below 2. install copy-webpack-plugin, Will have ...

  8. ios Introducing third-party libraries The runtime cannot find the function implementation

    Today we introduce webtrends This library , As a result, the function cannot be found when it runs all the time , Wondering all afternoon ! It turned out , yes other flag No settings for , For those that contain category To extend ios Libraries of primitive types , You need a special chain when you link ...

  9. android Problems and solutions arising from the introduction of a third-party library into the project

    One . Import libar Warehouse engineering 1. Use a third-party library project libary, Basically from github Upload and download , After decompression, there is a libary Folder 2. take libary Import to eclipse in , Steps are as follows 1) stay eclipse package ...

  10. iOS Overview of third-party libraries used in development

    Preface : Record the third-party libraries you have used and contacted , Importance has nothing to do with order Network request : AFNetworking:AFNetworking is a delightful networking library for ...

Random recommendation

  1. OKHttp Easy to use

    OKHttp Simple use One side , Recently about OKHttp There is a lot of discussion about , On the other hand , I also updated recently android6.0, Found in 6.0 in HttpClient It can't be used , So I decided to take the time to have a look OKHttp, summary ...

  2. soj 1700 ping_ Simple dp

    Topic link The question : Here's an undirected graph , seek n The shortest path of the edge Ideas : I haven't thought about it for a long time , At the end of the game, go back and have a look dp do , my dp It needs to be improved sp[i][k]=min(sp[j][k-1]+dp[j][i])/ ...

  3. PHP Basic example : Simple online file management

    Cut a picture first : Here's the code , Because there's only one file , So it doesn't fold . <?php // Simple online file management $path = "./"; $filelist=array("f ...

  4. WPF Adaptive window size

    Set different resolutions and larger sizes on the desktop DPI Next , How the window is displayed . Scheme 1 Set the window maximum and minimum display By comparing the displayable area of the current screen , Set the maximum and minimum window height and width , Set to the actual height and width of the window ( In this example, only the height... Is set ) Interface settings ...

  5. redisi application -- The bloon filter

    But if we want to know if a certain value is already in HyperLogLog Inside the structure , There's nothing it can do , It only provides pfadd and pfcount Method , Not provided pfcontains This method .

  6. [EOJ629] Two flowers

    Description Give a tree with \(1\) Root \(n\) Tree of nodes . Definition \(f(k)\) : Randomly selected from the tree with equal probability \(k\) Nodes , this \(k\) The expectation of the virtual tree size of a point . One point \( ...

  7. hive Adjustment of optimization mapreduce number

    One . adjustment hive In homework map Count 1. Usually , The assignment will pass input Creates one or more directories map Mission . The main determinants are : input The total number of files ,input File size , Cluster set file block size ( At present for 1 ...

  8. Gym 100247C Victor&#39;s Research( How many intervals is the sum of S)

    https://vjudge.net/problem/Gym-100247C The question : Give a string of numbers , Find how many intervals the sum of which is exactly equal to S. Ideas : Calculate the prefix and , And use map Maintain each prefix and the number of occurrences . Take it like this ...

  9. Skip copy error ——slave_skip_errors、slave_exec_mode

    This article describes the other two parameters related to replication error handling slave_skip_errors.slave_exec_mode, Basic environmental reference < Copy error handling ——sql_slave_skip_counter> One . ...

  10. Angular Different versions correspond to Bootstrap Components

    AngularJS 1.x The version corresponds to bootstrap The component library is ui-bootstrap; http://www.cnblogs.com/pilixiami/p/5597634.html Angula ...