{"id":1701,"date":"2020-04-05T21:28:13","date_gmt":"2020-04-05T21:28:13","guid":{"rendered":"https:\/\/sezeromer.com\/?p=1701"},"modified":"2023-02-27T22:30:28","modified_gmt":"2023-02-27T19:30:28","slug":"swift-pod","status":"publish","type":"post","link":"https:\/\/sezeromer.com\/en\/swift-pod\/","title":{"rendered":"Swift Pod"},"content":{"rendered":"<p>Hello friends. In this article I will talk about what <strong>Pod<\/strong> is and what it is used for.<\/p>\n<p>It is an environment where we integrate packages for pod swift into our project. We do transactions through the terminal. It allows you to do transactions with <strong>Nuget Package Manager<\/strong> if you have <strong>Xamarin<\/strong> or .<strong>NET<\/strong> history or if you have <strong>Android<\/strong> history with <strong>Gradle<\/strong>. To use pods, we first need to add the computer pod. Addition is simple. You can add it to the terminal screen with only 1 line of code. Just run the following line of code.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">sudo gem install cocoapods<\/pre>\n<\/div>\n<p>The terminal will then ask you for your computer password. It needs to download a few files from the Internet. Depending on your internet speed, the duration may vary. We have to wait a bit for this.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1702\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.08.15-1024x701.png\" alt=\"\" width=\"640\" height=\"438\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.08.15-1024x701.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.08.15-300x205.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.08.15-768x526.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.08.15.png 1394w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>After installing the pod on our computer, we can add packages to our project. If we come to how to add the packages; we need to create a Pod file first. We will be doing this again through the terminal. We need to go to the location of our project file via the terminal. 2 commands are enough for this. These are the cd and ls commands.<\/p>\n<p>cd: Open file directory<\/p>\n<p>ls: Lists the file directory.<\/p>\n<p>I create a project called PodSample, then open this project directory via the terminal. When you run the command line below in the project file, you will see a Pod file is created.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">pod init<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1703\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.14.23-1024x701.png\" alt=\"\" width=\"640\" height=\"438\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.14.23-1024x701.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.14.23-300x205.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.14.23-768x526.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.14.23.png 1394w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1704\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.15.13-1024x670.png\" alt=\"\" width=\"640\" height=\"419\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.15.13-1024x670.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.15.13-300x196.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.15.13-768x503.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.15.13-1536x1006.png 1536w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.15.13.png 1674w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>We need to open this Pod file and manually write the package names here. For the sake of example, I will add a simple bit Pod. For this, there is a package that we use in almost every project; SVProgressHud. I add this package to my Pod. If you want to get more detailed information about the package, you can find it <a href=\"https:\/\/github.com\/SVProgressHUD\/SVProgressHUD\">here<\/a>. The contents of my pod file are created as follows.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;swift&quot;,&quot;mime&quot;:&quot;text\/x-swift&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:true,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\"># Uncomment the next line to define a global platform for your project\r\n# platform :ios, '9.0'\r\n\r\ntarget 'PodSample' do\r\n  # Comment the next line if you don't want to use dynamic frameworks\r\n  use_frameworks!\r\n\r\n  # Pods for PodSample\r\n  pod 'SVProgressHUD'\r\nend<\/pre>\n<\/div>\n<p>Then we need to install this pod again in the project directory from the terminal. When you run the command below you will see that it is installed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1705\" src=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.19.38-1024x701.png\" alt=\"\" width=\"640\" height=\"438\" srcset=\"https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.19.38-1024x701.png 1024w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.19.38-300x205.png 300w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.19.38-768x526.png 768w, https:\/\/sezeromer.com\/wp-content\/uploads\/2020\/04\/Screen-Shot-2020-04-06-at-00.19.38.png 1394w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Then we can open our project and use this Pod. If you have any questions, you can reach them by e-mail or comment. Good work.<\/p>","protected":false},"excerpt":{"rendered":"<p>Hello friends. In this article I will talk about what Pod is and what it is used for. It is an environment where we integrate packages for pod swift into our project. We do transactions through the terminal. It allows you to do transactions with Nuget Package Manager if you have Xamarin or .NET history [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1706,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[327],"tags":[666,668,115,297,665,667,328,22],"class_list":["post-1701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swift","tag-cocoa-pods","tag-gradle","tag-ios","tag-nuget","tag-pod","tag-sv-progress-hud","tag-swift","tag-xamarin"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1701"}],"collection":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/comments?post=1701"}],"version-history":[{"count":4,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1701\/revisions"}],"predecessor-version":[{"id":2642,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/posts\/1701\/revisions\/2642"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media\/1706"}],"wp:attachment":[{"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/media?parent=1701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/categories?post=1701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sezeromer.com\/en\/wp-json\/wp\/v2\/tags?post=1701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}