<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Robert Chen</title>
    <description>The latest articles on DEV Community by Robert Chen (@robghchen).</description>
    <link>https://dev.to/robghchen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F173851%2Fcbdd3421-5209-4bb9-80b3-2ccc42950557.png</url>
      <title>DEV Community: Robert Chen</title>
      <link>https://dev.to/robghchen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/robghchen"/>
    <language>en</language>
    <item>
      <title>Learn redux-optimist</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Sat, 14 Dec 2019 19:50:13 +0000</pubDate>
      <link>https://dev.to/robghchen/learn-redux-optimist-3fj1</link>
      <guid>https://dev.to/robghchen/learn-redux-optimist-3fj1</guid>
      <description>&lt;p&gt;Simplify optimistic rendering with redux-optimist library&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@robghchen/learn-redux-optimist-ca1a41a82165?source=rss-1a2b6738cba4------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5hzNmzrk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/1616/1%2AlfZHSaNa6ViCsNxIpwGurA.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The redux-optimist library has been extremely helpful to me and I’d like to share that with you. I’ve designed a simple tutorial where I’ll walk you through how to set up and use the middleware. We’re going to use a sweet pokemon API as our demo practice. We’ll fetch this Pikachu and optimistically evolve it to Raichu. If the request fails, then we’ll devolve back to Pikachu.&lt;/p&gt;

&lt;p&gt;1) Let’s install the dependencies we need, in your terminal:&lt;br&gt;
&lt;code&gt;yarn create react-app app-name&lt;/code&gt;&lt;br&gt;
&lt;code&gt;cd app-name&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn add react-dom&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn add react-router-dom&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn add react-redux&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn add redux&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn add redux-thunk&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn add lodash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2) Follow along to set up Redux, or skip ahead to step 3 if you have your own preferred redux setup.&lt;/p&gt;

&lt;p&gt;a. &lt;code&gt;open src/index.js&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;b. create action file, in your terminal: &lt;code&gt;touch src/pokemonActions.js &amp;amp;&amp;amp; open src/pokemonActions.js&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;c. create reducer file, in your terminal: &lt;code&gt;touch src/reducer.js &amp;amp;&amp;amp; open src/reducer.js&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;d. &lt;code&gt;open src/App.js&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;e. &lt;code&gt;open src/App.css&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;3) Let’s install redux-optimist now, in your terminal:&lt;br&gt;
&lt;code&gt;yarn add redux-optimist&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;4) I suggest commiting here, that way you can see your git diff before implementing &lt;code&gt;redux-optimist&lt;/code&gt; and after &lt;code&gt;redux-optimist&lt;/code&gt;:&lt;br&gt;
&lt;code&gt;git add . &amp;amp;&amp;amp; git commit -m "feat(redux): finished setting up redux"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;5) Modify our &lt;code&gt;pokemonActions.js&lt;/code&gt; to create new actions and pass some responsibility to the &lt;code&gt;redux-optimist&lt;/code&gt; library:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;6) Create a &lt;code&gt;middleware&lt;/code&gt; folder and create this file &lt;code&gt;getRaichu.js&lt;/code&gt; inside the folder, in your terminal: &lt;code&gt;mkdir src/middleware &amp;amp;&amp;amp; touch src/middleware/getRaichu.js &amp;amp;&amp;amp; open src/middleware/getRaichu.js&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;7) Import and use the &lt;code&gt;getRaichu.js&lt;/code&gt; middleware in our &lt;code&gt;index.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;8) Modify our reducer.js to work with the new actions and middleware:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;9) Now in your terminal, &lt;code&gt;yarn start&lt;/code&gt; and open up your console. I’ve placed a couple &lt;code&gt;console.log&lt;/code&gt; to help observe the procedure of our action, middleware, and reducer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v51HcEaN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/6720/1%2Aha6OEjZuWhUCXlVRpqNnGw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v51HcEaN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/6720/1%2Aha6OEjZuWhUCXlVRpqNnGw.gif" alt="GET_RAICHU_COMPLETE"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You’ll notice that the object in &lt;code&gt;GET_RAICHU_BEGIN&lt;/code&gt; is a mock Raichu where I only supplied the name and image, then when the request succeeds, &lt;code&gt;GET_RAICHU_COMPLETE&lt;/code&gt; sends the full object returned from the API to update our store.&lt;/p&gt;

&lt;p&gt;10) Now let’s imitate a failed request by commenting out the fetch request on line 32 in &lt;code&gt;getRaichu.js&lt;/code&gt; and commenting in line 33.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Nn5YPmf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/6720/1%2AhgAma4RZeIuJdhxVvTr1Vg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Nn5YPmf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://miro.medium.com/max/6720/1%2AhgAma4RZeIuJdhxVvTr1Vg.gif" alt="GET_RAICHU_FAILED"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This time you will see that we optimistically render Raichu until the request comes back as a fail. The store will automatically revert back to Pikachu. At this time we also capture the error from the failed request and display it to the user. So moral of the story, don’t evolve your Pikachu :)&lt;/p&gt;




&lt;p&gt;Here are screenshots of the git diff from our usual &lt;code&gt;redux&lt;/code&gt; to implementing &lt;code&gt;redux-optimist&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qr9WdE8a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ldvdrxpcr5v2u283hw20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qr9WdE8a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ldvdrxpcr5v2u283hw20.png" alt="index.js diff"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nU_uk5yB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/f1nka7mmnzhglzbgwn2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nU_uk5yB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/f1nka7mmnzhglzbgwn2e.png" alt="pokemonActions.js diff"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jZttvuQn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b2jrzk54k56vfn25vrm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jZttvuQn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b2jrzk54k56vfn25vrm0.png" alt="getRaichu.js diff"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q30-3Ye---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xrz09k3rinto8a2zinno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q30-3Ye---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/xrz09k3rinto8a2zinno.png" alt="reducer.js diff"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it for optimistic rendering with the redux-optimist library! Hope this was helpful!&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>redux</category>
      <category>react</category>
      <category>javascript</category>
      <category>optimistic</category>
    </item>
    <item>
      <title>How to SCSS</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Mon, 01 Jul 2019 04:23:29 +0000</pubDate>
      <link>https://dev.to/robghchen/how-to-scss-i1j</link>
      <guid>https://dev.to/robghchen/how-to-scss-i1j</guid>
      <description>&lt;p&gt;Learn SCSS features with simple create-react-app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@robghchen/how-to-scss-59d5adbad601?source=rss-1a2b6738cba4------2" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2ADs9dmDmQOBLi6A5xSyE1AA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1) In terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create-react-app scss-demo
cd scss-demo
npm i node-sass
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2) Rename &lt;code&gt;App.css&lt;/code&gt; to &lt;code&gt;App.scss&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) In &lt;code&gt;App.js&lt;/code&gt;, on line 3 change &lt;code&gt;import './App.css';&lt;/code&gt; to &lt;code&gt;import 'App.scss';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;4) Take a look at &lt;code&gt;App.scss&lt;/code&gt;, then replace the code in &lt;code&gt;App.scss&lt;/code&gt; with this:&lt;/p&gt;

&lt;p&gt;Notice in the following scss code that we can:&lt;br&gt;
&lt;strong&gt;a) Make variables with the $ symbol&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;b) Have nested element tags that reflect our HTML hierarchy&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;This should look exactly like the create-react-app default page like what we’re used to seeing.&lt;/p&gt;

&lt;p&gt;5) Let’s say we want to make the “Edit src/App.js and save to reload.” bold for mobile devices. This is a good opportunity to show you how to import another .scss file. This helps us separate responsibilities and keep our scss organized. In terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch /src/_mobile.scss
open /src/_mobile.scss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;6) In &lt;code&gt;_mobile.scss&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;7) Add &lt;code&gt;@import 'mobile'&lt;/code&gt;; to the top of &lt;code&gt;App.scss&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;8) We can even &lt;strong&gt;make functions in scss&lt;/strong&gt;, add the following code to &lt;code&gt;App.scss&lt;/code&gt; before your element selectors:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;9) In &lt;code&gt;App.scss&lt;/code&gt;, within &lt;code&gt;.App-link&lt;/code&gt; selector, add &lt;code&gt;@include grow(2em)&lt;/code&gt;, it should look like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Try changing the 2em argument.&lt;/p&gt;

&lt;p&gt;10) To show you how to use classes in scss, let’s add a &lt;code&gt;ul&lt;/code&gt; tag and an &lt;code&gt;ol&lt;/code&gt; tag in our jsx. In &lt;code&gt;App.js&lt;/code&gt;, within &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; and after &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tag:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
 

&lt;p&gt;11) Now back to &lt;code&gt;App.scss&lt;/code&gt;, under the &lt;code&gt;grow&lt;/code&gt; function, we’re going to &lt;strong&gt;write a class&lt;/strong&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;12) Let’s use our &lt;code&gt;%list-item&lt;/code&gt; class. Within &lt;code&gt;.App-header&lt;/code&gt; selector, under &lt;code&gt;.App-link&lt;/code&gt; selector, add the following code:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;13) In our &lt;code&gt;%list-item&lt;/code&gt; class, let’s multiply &lt;code&gt;padding: 0.5em&lt;/code&gt; by &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Weird, that’s not a thing in normal css, but try it yourself and rejoice! These are the basic superpowers that you gain from using scss. There are even more powerful features, but let’s wrap for now. Enjoy your newfound abilities!&lt;/p&gt;




&lt;p&gt;In case you want to see the final code for this tutorial, here is &lt;code&gt;App.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Here is &lt;code&gt;App.scss&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;





&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com" rel="noopener noreferrer"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>scss</category>
      <category>sass</category>
      <category>react</category>
    </item>
    <item>
      <title>How to Scrape a Static Website</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Sun, 23 Jun 2019 22:04:42 +0000</pubDate>
      <link>https://dev.to/robghchen/how-to-scrape-a-static-website-2jbh</link>
      <guid>https://dev.to/robghchen/how-to-scrape-a-static-website-2jbh</guid>
      <description>&lt;p&gt;A really quick tutorial&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@robghchen/how-to-scrape-a-static-website-846bd9c6ed28?source=rss-1a2b6738cba4------2" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F920%2F1%2A-Znz9nj6-14ZG-9c0-u0og.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Prerequisites: Knowledge of &lt;a href="http://reactjs.org/" rel="noopener noreferrer"&gt;React.js&lt;/a&gt; will be required for this tutorial.&lt;/p&gt;

&lt;p&gt;Let’s say you want to pull data from the frontend of a website because there’s no API available. You inspect the page and see that the data is available in the HTML, so how do you gather that information to be used in your app? It’s rather simple, we’re going to install two libraries and write less than 50 lines of code to demonstrate the scraping of a website. To keep this tutorial simple, we’ll use &lt;a href="https://pokedex.org/" rel="noopener noreferrer"&gt;https://pokedex.org/&lt;/a&gt; as our example.&lt;/p&gt;

&lt;p&gt;1) In terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create-react-app scraping-demo
cd scraping-demo
npm i request-promise
npm i cheerio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2) We’re going to start by using request-promise to get the HTML from &lt;a href="https://pokedex.org/" rel="noopener noreferrer"&gt;https://pokedex.org/&lt;/a&gt; into a console log.&lt;/p&gt;

&lt;p&gt;In App.js:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;3) Sometimes you may come across a CORS error blocking you from fetching. For demonstration purposes, try fetching pokemon.com&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rp("https://www.pokemon.com/us/pokedex/")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You should see an error like this in the console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2Act8FdJ0MQJyereWp-GgIVw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2Act8FdJ0MQJyereWp-GgIVw.png" alt="error"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4) You can get around CORS by using &lt;a href="https://cors-anywhere.herokuapp.com/" rel="noopener noreferrer"&gt;https://cors-anywhere.herokuapp.com&lt;/a&gt;. Simply add that URL before your desired fetch URL like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rp("https://cors-anywhere.herokuapp.com/https://www.pokemon.com/us/pokedex/")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now you should be able to see the HTML from pokemon.com show in your console.&lt;/p&gt;

&lt;p&gt;5) But we won’t have to use cors-anywhere for &lt;code&gt;rp("https://pokedex.org/")&lt;/code&gt;, so let’s proceed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2ArT4pqlQgL1VXqH2CmWHhkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2ArT4pqlQgL1VXqH2CmWHhkw.png" alt="console"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6) Now that we have the HTML, let’s use the cheerio library to help us grab the exact data that we want from desired element tags. In this example, we’ll grab all the names of the pokemon then display them in a list.&lt;/p&gt;

&lt;p&gt;In App.js:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;7) You should see a list of all the pokemon names display onto your screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2Af-rDVLjusI2zl-n1H0MkIg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F800%2F1%2Af-rDVLjusI2zl-n1H0MkIg.png" alt="list"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s that simple! You scraped those names from the HTML without having to directly access any backend. Now try scraping the examples on &lt;a href="http://toscrape.com/" rel="noopener noreferrer"&gt;http://toscrape.com/&lt;/a&gt; for practice. Enjoy your new abilities!&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com" rel="noopener noreferrer"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>data</category>
    </item>
    <item>
      <title>How to Use Google Translate API</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Sun, 16 Jun 2019 19:07:12 +0000</pubDate>
      <link>https://dev.to/robghchen/how-to-use-google-translate-api-27l9</link>
      <guid>https://dev.to/robghchen/how-to-use-google-translate-api-27l9</guid>
      <description>&lt;p&gt;An easy follow-along tutorial&lt;/p&gt;

&lt;p&gt;Prerequisites: Knowledge of &lt;a href="http://reactjs.org/" rel="noopener noreferrer"&gt;React.js&lt;/a&gt; will be required for this tutorial.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@robghchen/how-to-use-google-translate-api-e42e5eb380fb?source=rss-1a2b6738cba4------2" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s8g72y2cdea2ulxyi6z.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’re going to use &lt;a href="https://www.npmjs.com/package/google-translate" rel="noopener noreferrer"&gt;google-translate&lt;/a&gt; library to help connect your app with Google Translate API, the library also provides methods to initiate the translating. We’ll also use &lt;a href="https://www.npmjs.com/package/react-cookies" rel="noopener noreferrer"&gt;react-cookies&lt;/a&gt; library to store a user’s chosen language in the browser for the user’s convenience and we’ll store some translated text in a cookie so that the same sentence doesn’t have to be re-translated every time the user loads the app (you have to pay per translation, try to avoid redundant translating).&lt;/p&gt;

&lt;p&gt;1) Let’s get started, in terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

create-react-app google-translate-demo
cd google-translate-demo
npm i google-translate
npm i react-cookies


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;2) Get ready to create your API key and hide the key so that it doesn’t get pushed onto the internet. In terminal:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

touch .env
open .env


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;3) Sign into &lt;a href="https://accounts.google.com/signin/v2/identifier?service=cloudconsole&amp;amp;passive=1209600&amp;amp;osid=1&amp;amp;continue=https%3A%2F%2Fconsole.developers.google.com%2Fapis%2Fdashboard%3Fauthuser%3D3%26project%3Dtranslation-api-243302&amp;amp;followup=https%3A%2F%2Fconsole.developers.google.com%2Fapis%2Fdashboard%3Fauthuser%3D3%26project%3Dtranslation-api-243302&amp;amp;flowName=GlifWebSignIn&amp;amp;flowEntry=ServiceLogin" rel="noopener noreferrer"&gt;Google API Console&lt;/a&gt; with your Gmail then create your API key:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2cn2umn4u3c15xd1wyho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2cn2umn4u3c15xd1wyho.png" alt="1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fklp7i61twls8l87rtpdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fklp7i61twls8l87rtpdl.png" alt="2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpoph3fwxa4z9arwgy6ff.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpoph3fwxa4z9arwgy6ff.png" alt="3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1ulquk6xzu114tojknq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi1ulquk6xzu114tojknq.png" alt="4"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd74naq35ctbz64fmnc5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd74naq35ctbz64fmnc5a.png" alt="5"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth02vtqight3degb7zfz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fth02vtqight3degb7zfz.png" alt="6"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4) After creating the key, &lt;strong&gt;DO NOT&lt;/strong&gt; share it with anyone and &lt;strong&gt;ABSOLUTELY DO NOT&lt;/strong&gt; push that key to GitHub or anywhere online. Any fees accrued using that key will be charged to your account. I know someone who knows someone who owes Amazon $50,000+ because he unknowingly pushed his key to GitHub for only 3 days and someone went on a shopping spree with his key. With that said, now I’ll show you how to safely use and protect your key. &lt;/p&gt;

&lt;p&gt;5) In terminal:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

open .gitignore


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;6) Add &lt;code&gt;.env&lt;/code&gt; to line 25, this tells GitHub to ignore pushing your &lt;code&gt;.env&lt;/code&gt; file online.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;7) Create &lt;code&gt;.env&lt;/code&gt; on the top level of the app, Copy your key from Google Console and replace the string “PASTE YOUR KEY HERE”:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;8) In terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mkdir src/utils
touch src/utils/googleTranslate.js
open src/utils/googleTranslate.js


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;9) We use your API key through the variable that we created in &lt;code&gt;.env&lt;/code&gt; so that your actual key is safe from the public’s eye. In &lt;code&gt;googleTranslate.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you already have a server running, restart it so that &lt;code&gt;process.env.BLAH_BLAH_BLAH&lt;/code&gt; captures the most recent change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;10) Preparation is done, we can now build the app. In terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

open App.js


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;11) We’re going to create a simple select field and translate some text with the google-translate library that’s now connected to your Google Translate API key. In &lt;code&gt;App.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;12) Run the app. In terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npm start


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94m3b0w5r21sa7u10cxf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94m3b0w5r21sa7u10cxf.gif" alt="demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the language, refresh the page and verify that it loads with the language you last selected.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congrats! Now that you’ve seen how to set up Google Translate API and use the &lt;a href="https://www.npmjs.com/package/google-translate" rel="noopener noreferrer"&gt;google-translate&lt;/a&gt; + &lt;a href="https://www.npmjs.com/package/react-cookies" rel="noopener noreferrer"&gt;react-cookies&lt;/a&gt; libraries, let’s clean up. Go back to Google Console and delete your API key, that’ll guarantee no one else can use your key without your knowledge.&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com" rel="noopener noreferrer"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>googletranslate</category>
      <category>api</category>
      <category>cookies</category>
      <category>react</category>
    </item>
    <item>
      <title>How to use Gaia Storage with Blockstack</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Fri, 31 May 2019 20:33:16 +0000</pubDate>
      <link>https://dev.to/robghchen/how-to-use-gaia-storage-with-blockstack-917</link>
      <guid>https://dev.to/robghchen/how-to-use-gaia-storage-with-blockstack-917</guid>
      <description>&lt;h3&gt;
  
  
  Final part of a three-part tutorial
&lt;/h3&gt;

&lt;p&gt;In part two, &lt;a href="https://dev.to/robghchen/how-to-connect-blockstack-to-your-backend-api-2bo0"&gt;How to Connect Blockstack to your Backend API&lt;/a&gt;, I show you how to create a user object in your API after logging in with Blockstack. In this tutorial, we’ll build a form that sends public information to that API and a separate form that sends secret/sensitive information to Gaia Storage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/better-programming/how-to-use-gaia-storage-with-blockstack-c188458bad7?source=rss-1a2b6738cba4------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p9CYry3s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AJiRRbVU9s-EIYLuUTctQaw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Blockstack applications use the Gaia storage system to store data on behalf of a user. When the user logs in to an application, the authentication process gives the application the URL of a Gaia hub, which performs writes on behalf of that user. The Gaia hub authenticates writes to a location by requiring a valid authentication token, generated by a private key authorized to write at that location.
&lt;/h6&gt;

&lt;p&gt;By using Gaia Storage, the decentralized way of storing information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your data is more secure than traditional storage systems, which have one or a few central points of vulnerability.&lt;/li&gt;
&lt;li&gt;Millions of encrypted copies of your data are spread across the world, constantly verifying each other for changes made without your authorization.&lt;/li&gt;
&lt;li&gt;A hacker would need to compromise 51% of the blockchain in order to access your data. This would require more computing power than any known entity possesses.&lt;/li&gt;
&lt;li&gt;You own your own data, your information will be safe and no one can access it, not me, not Blockstack, not even the president.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;: Knowledge of setting up your own &lt;a href="https://dev.to/robghchen/launch-a-rails-database-in-under-5-minutes-1453"&gt;API&lt;/a&gt;. We’ll also be using &lt;a href="http://reactjs.org/"&gt;React.js&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Coming from &lt;a href="https://dev.to/robghchen/how-to-connect-blockstack-to-your-backend-api-2bo0"&gt;part two&lt;/a&gt; of this three-part tutorial series, this is what &lt;code&gt;App.js&lt;/code&gt; looked like:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We’re going to add a form in JSX and some handler methods to use our API. We’ll, do the same for Gaia Storage but in the Blockstack way. Skip to step 6 if you only want to see the final code.&lt;/p&gt;

&lt;p&gt;1) We’ll be adding a few placeholders to your app’s state:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;2) Within the App class, we’ll add the changeHandler, submitHandler, and submitGaiaHandler functions for the forms (be sure to add the &lt;code&gt;superhero&lt;/code&gt; attribute to your backend for the fetch PATCH request):&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;3) Within the App class, we’ll add a function to retrieve data from Gaia Storage:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;4) Call &lt;code&gt;getGaiaUser()&lt;/code&gt; function in &lt;code&gt;componentDidMount()&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;5) In &lt;code&gt;render()&lt;/code&gt;, we’ll add the JSX for our new forms:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;6) At the end of this process, &lt;code&gt;App.js&lt;/code&gt; should look like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;7) Let’s sprinkle some CSS on this in &lt;code&gt;App.css&lt;/code&gt; and make it a little easier on the eyes:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;8) Test the two different forms, open console to see the data that is returned upon submitting each form.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pMi1OI9b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1200/1%2A716_jPPAL2FqInaY99aq4Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pMi1OI9b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1200/1%2A716_jPPAL2FqInaY99aq4Q.png" alt="forms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;9) You should see encrypted information if you click the link that Gaia Storage returns on App.js:134:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bleFM1Wi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AsGU89mBSB_Tu1Sev2DYOdQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bleFM1Wi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AsGU89mBSB_Tu1Sev2DYOdQ.png" alt="console"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1p2YVGhT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_wsCiAJzMMOdyw8dOupcEw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1p2YVGhT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_wsCiAJzMMOdyw8dOupcEw.png" alt="json"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Congratulations for making it to the end of this tutorial! You have now successfully implemented Blockstack authentication, connected Blockstack to a public API, and securely transferred data to Gaia Storage.&lt;/p&gt;

&lt;p&gt;There is still lots to learn, but you now have the fundamentals to start building decentralized and hybrid apps. Remember you can always dive into the &lt;a href="https://docs.blockstack.org/"&gt;Blockstack documentation&lt;/a&gt; or reach out to the &lt;a href="https://community.blockstack.org/slack"&gt;community on Slack&lt;/a&gt; if you get stuck.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nwVbFUGk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2ArUqG_UvAwTCKQYGSoEzrrw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nwVbFUGk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2ArUqG_UvAwTCKQYGSoEzrrw.png" alt="app mining"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for following along through all of the tutorials, reach out if you have any questions. Wish you the best in your blockchain endeavors!&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>blockstack</category>
      <category>decentralization</category>
      <category>api</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>How to Connect Blockstack to your Backend API</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Mon, 20 May 2019 20:05:49 +0000</pubDate>
      <link>https://dev.to/robghchen/how-to-connect-blockstack-to-your-backend-api-2bo0</link>
      <guid>https://dev.to/robghchen/how-to-connect-blockstack-to-your-backend-api-2bo0</guid>
      <description>&lt;h3&gt;
  
  
  Part two of a three-part tutorial
&lt;/h3&gt;

&lt;p&gt;In part one, &lt;a href="https://dev.to/robghchen/how-to-build-your-first-blockchain-app-on-blockstack-2n01"&gt;How To Build Your First Blockchain App on Blockstack&lt;/a&gt;, I show you how to set up Blockstack login/signup. In this tutorial, we’ll connect the unique username that visitors create on Blockstack to your back end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/better-programming/how-to-connect-blockstack-to-your-backend-api-4643f5a331a4?source=rss-1a2b6738cba4------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--28KBth7n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2AhqsZrbxFXMF6CXtQXiD0TA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;: Knowledge of setting up your own &lt;a href="https://dev.to/robghchen/launch-a-rails-database-in-under-5-minutes-1453"&gt;API&lt;/a&gt; will be required. We’ll also be using &lt;a href="http://reactjs.org/"&gt;React.js&lt;/a&gt; for this tutorial.&lt;/p&gt;

&lt;p&gt;While you would want to send private information such as phone numbers and addresses to &lt;a href="https://github.com/blockstack/gaia"&gt;Gaia Storage&lt;/a&gt; (a decentralized storage system), what I’m about to show you is useful for storing public information like comments or posts where you might want that information available on a public API.&lt;/p&gt;

&lt;p&gt;Coming from &lt;a href="https://dev.to/robghchen/how-to-build-your-first-blockchain-app-on-blockstack-2n01"&gt;part one&lt;/a&gt; of this three-part tutorial series, this is what App.js looked like:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We’re going to add two methods that’ll connect Blockstack to your API. Skip to step 6 if you only want to see the final code.&lt;/p&gt;

&lt;p&gt;1) We’ll be adding the following placeholders to your app’s &lt;code&gt;state&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;2) Within the App class, we’ll add this function which does the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;3) Within the App class, we’ll add another function that takes the username from Blockstack and creates a new user object in your API:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;4) Call &lt;code&gt;getUsers()&lt;/code&gt; function in &lt;code&gt;componentDidMount()&lt;/code&gt;, add this line to the existing code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.getUsers();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;5) In &lt;code&gt;render()&lt;/code&gt;, we’ll add a welcome greeting above the Sign Out button in order to see that all is working correctly:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;6) At the end of this process, &lt;code&gt;App.js&lt;/code&gt; should look like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;7) Let’s quickly center the greeting div by adding this snippet to &lt;code&gt;App.css&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.hello {
  margin: auto;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8) Sign in, then verify that the user object is getting created in your back end:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oQFTRGkM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AO4F6rCFNrQEUq5atuxj4pw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oQFTRGkM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AO4F6rCFNrQEUq5atuxj4pw.png" alt="api"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;9) Sign out and sign back in to verify that the user object does not get duplicated if it already exists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w1HQT3Z2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AI6vhW-UtSLeLoEcgflEmBA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w1HQT3Z2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AI6vhW-UtSLeLoEcgflEmBA.png" alt="signed in"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now connect Blockstack authentication with your own custom back end and build the user object however you’d like. Have fun with it!&lt;/p&gt;

&lt;p&gt;In the final part of this tutorial, I’ll show you &lt;a href="https://dev.to/robghchen/how-to-use-gaia-storage-with-blockstack-917"&gt;How to Use Gaia Storage with Blockstack&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>decentralization</category>
      <category>blockchain</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>How To Build Your First Blockchain App on Blockstack</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Thu, 16 May 2019 19:45:33 +0000</pubDate>
      <link>https://dev.to/robghchen/how-to-build-your-first-blockchain-app-on-blockstack-2n01</link>
      <guid>https://dev.to/robghchen/how-to-build-your-first-blockchain-app-on-blockstack-2n01</guid>
      <description>&lt;h3&gt;
  
  
  A tutorial to build your first app on the decentralized web
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://medium.com/better-programming/start-building-blockchain-apps-now-a1ebe8f35ee7?source=rss-1a2b6738cba4------2"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s9WlhukN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/600/1%2Ai1vivvw4SPmT_6-pl3C_6A.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Blockstack is a network for decentralized applications. This platform leverages a serverless architecture, which helps &lt;strong&gt;&lt;em&gt;remove&lt;/em&gt;&lt;/strong&gt; critical points of vulnerability. By eliminating these weak points, which have frequently fallen victim to hacks, Blockstack makes user data more secure.
&lt;/h6&gt;

&lt;p&gt;Prerequisites: Knowledge of &lt;a href="http://reactjs.org/"&gt;React.js&lt;/a&gt; will be required for this tutorial.&lt;/p&gt;

&lt;p&gt;Blockchain tech can be complicated, but getting started doesn’t have to be. &lt;a href="https://blockstack.org/"&gt;Blockstack&lt;/a&gt;’s 3rd party sign in/sign up/authentication makes it easy to get started developing apps and publishing it to a decentralized App store like &lt;a href="https://app.co/"&gt;App.co&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CKAACUPO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_bWaCp4pSYN8sZfH1xTxEQ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CKAACUPO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A_bWaCp4pSYN8sZfH1xTxEQ.gif" alt="codecoderevolution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  I was able to publish this on App.co in less than a week
&lt;/h6&gt;

&lt;p&gt;After integrating Blockstack, you have the option to either send the unique username that a user creates from Blockstack to your own API and build the user object that way, or use Gaia Storage, Blockstack’s decentralized backend provider. You can also opt to have a combination of both, where private user information like phone numbers and addresses are encrypted and stored in Gaia Storage but public information like comments or posts are stored in a public API.&lt;/p&gt;

&lt;p&gt;This blog post is meant to simplify and abstract as much as possible. If you would like deep dive video tutorials, check out &lt;a href="https://youtu.be/Arb-dwU5SZI"&gt;Tech Rally&lt;/a&gt; on YouTube (this is where I learned about Blockstack).&lt;/p&gt;

&lt;p&gt;For now, we’ll cover getting Blockstack Sign In/Sign Out authentication set up. Let’s get started!&lt;/p&gt;

&lt;p&gt;1) Install &lt;a href="https://blockstack.org/install"&gt;Blockstack Browser&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Create your Blockstack ID (&lt;strong&gt;be sure to save your Secret Recovery Key somewhere safe&lt;/strong&gt;)&lt;br&gt;
In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init react-app blockstack-tutorial
cd blockstack-tutorial
npm install --save blockstack@19.0.0-alpha.2
npm install react-app-rewired --save-dev
mkdir src/utils
touch src/utils/constants.js
open src/utils/constants.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If &lt;code&gt;npm install&lt;/code&gt; gives you a problem, try &lt;code&gt;yarn add&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add blockstack@19.0.0-alpha.2
yarn add react-app-rewired --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;4) &lt;code&gt;constants.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { AppConfig } from 'blockstack'
export const appConfig = new AppConfig(['store_write', 'publish_data'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;5) In your terminal:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch config-overrides.js
open config-overrides.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;6) &lt;code&gt;config-overrides.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;7) In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open package.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;8) &lt;code&gt;package.json&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;9) In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open src/App.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;10) &lt;code&gt;App.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;11) In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open src/index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;12) &lt;code&gt;index.js&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;13) In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;open src/App.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;14) &lt;code&gt;App.css&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;15) In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! Simple, but powerful —you are now connected to Blockstack.&lt;/p&gt;

&lt;p&gt;In part two of this series, I’ll show you &lt;a href="https://dev.to/robghchen/how-to-connect-blockstack-to-your-backend-api-2bo0"&gt;How to Connect Blockstack to your Backend API&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>decentralization</category>
      <category>software</category>
      <category>blockstack</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Launch a Rails database in under 5 minutes</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Thu, 03 Jan 2019 20:57:23 +0000</pubDate>
      <link>https://dev.to/robghchen/launch-a-rails-database-in-under-5-minutes-1453</link>
      <guid>https://dev.to/robghchen/launch-a-rails-database-in-under-5-minutes-1453</guid>
      <description>&lt;h3&gt;
  
  
  A step by step tutorial
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LOEAtdKe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADrtYN01WmB_xA819CyE6GQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LOEAtdKe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADrtYN01WmB_xA819CyE6GQ.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will be strictly instructional, follow this step by step guide to quickly build your backend.&lt;/p&gt;

&lt;p&gt;1) In your terminal: &lt;code&gt;rails new APP-NAME --api&lt;/code&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Or add this flag if you have Postgres installed and would like to use it: &lt;code&gt;rails new APP-NAME --database=postgresql —-api&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If you choose to use Postgres, remember to turn Postgres on when you launch your server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) In your terminal: &lt;code&gt;cd APP-NAME &amp;amp;&amp;amp; open Gemfile&lt;/code&gt;, then find and uncomment &lt;code&gt;gem 'rack-cors'&lt;/code&gt;, then add this line of code on the next line: &lt;code&gt;gem 'active_model_serializers'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) In your terminal: &lt;code&gt;bundle &amp;amp;&amp;amp; open config/initializers/cors.rb&lt;/code&gt;, then uncomment the following code and use &lt;em&gt;&lt;code&gt;*&lt;/code&gt;&lt;/em&gt; for &lt;em&gt;origins&lt;/em&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;4) In your terminal: &lt;code&gt;open config/routes.rb&lt;/code&gt;, then add namespacing and resources:&lt;br&gt;&lt;br&gt;
&lt;code&gt;# resources :posts, only: [:index, :create]&lt;/code&gt; is an example for when you have more models.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;5) In your terminal: &lt;code&gt;rails g model User username password_digest&lt;/code&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace User with the model that you need.
&lt;/li&gt;
&lt;li&gt;Replace username with the attributes that you need.&lt;/li&gt;
&lt;li&gt;We’re going to keep &lt;code&gt;User&lt;/code&gt; as our example model going forward.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6) In your terminal: &lt;code&gt;open app/models/user.rb&lt;/code&gt;, then add your relationships:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;7) In your terminal: &lt;code&gt;rails g controller api/v1/Users&lt;/code&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;Users&lt;/code&gt; with the controller that you need.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;8) In your terminal: &lt;code&gt;open app/controllers/api/v1/users_controller.rb&lt;/code&gt;, then add methods:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;9) In your terminal: &lt;code&gt;rails g serializer User&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;User&lt;/code&gt; with the model that you need.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;10) In your terminal: &lt;code&gt;open app/serializers/user_serializer.rb&lt;/code&gt;, then add attributes and relationships to other models:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uncomment &lt;code&gt;has_many :posts&lt;/code&gt; after creating your other model(s).&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;11) In your terminal: &lt;code&gt;rails db:create &amp;amp;&amp;amp; rails db:migrate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;12) Test this by running &lt;code&gt;rails c&lt;/code&gt; in your terminal then &lt;code&gt;User.create(username: 'bob')&lt;/code&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Ctrl + D&lt;/em&gt; to quit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;13) Launch! Type &lt;code&gt;rails s&lt;/code&gt; in your terminal then go to &lt;code&gt;[http://localhost:3000/api/v1/users](http://localhost:3000/api/v1/users)&lt;/code&gt; in your browser.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Ctrl + C&lt;/em&gt; to quit.
&lt;/li&gt;
&lt;li&gt;If not &lt;code&gt;localhost:3000&lt;/code&gt;, your terminal will tell you:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// rails s
=&amp;gt; Booting Puma
=&amp;gt; Rails 5.2.2 application starting in development
=&amp;gt; Run `rails server -h` for more startup options
Puma starting in single mode…
* Version 3.12.0 (ruby 2.3.4-p301), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat steps 4–10 for your other models and that’s it, you’re done (with your backend).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/rfWAomOTPeOo8/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/rfWAomOTPeOo8/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Bring your friends and come learn JavaScript in a fun never before seen way! &lt;a href="https://waddlegame.com"&gt;waddlegame.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>ruby</category>
      <category>postgres</category>
      <category>backend</category>
    </item>
    <item>
      <title>Introduction to XCode for iOS</title>
      <dc:creator>Robert Chen</dc:creator>
      <pubDate>Mon, 03 Dec 2018 00:39:46 +0000</pubDate>
      <link>https://dev.to/robertchen/introduction-to-xcode-for-ios-3dki</link>
      <guid>https://dev.to/robertchen/introduction-to-xcode-for-ios-3dki</guid>
      <description>&lt;h3&gt;
  
  
  A step by step tutorial
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JqyhJfMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ANWfbAtNEvu_8UEH3" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JqyhJfMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ANWfbAtNEvu_8UEH3" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/photos/n31x0hhnzOs?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Yura Fresh&lt;/a&gt; on &lt;a href="https://unsplash.com/search/photos/ios?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Always wanted to build an app? Didn’t know how? Me neither, until I took some online courses and found that it’s not that hard (to build a simple app). You can too, follow this guide and get familiarized with XCode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3rU6fl4D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/372/0%2AI2pq9MZHbb9T51Xb" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3rU6fl4D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/372/0%2AI2pq9MZHbb9T51Xb" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m currently a Flatiron School student in their Immersive Web Dev Program and learning Swift on Sundays with App Brewery through Udemy so I know very well that learning how to develop can be intimidating. In this post, there won’t be any coding. We’ll focus on getting you set up and familiar with the numerous XCode panels.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Let’s get you situated!&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install the latest version of XCode &lt;a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12"&gt;here&lt;/a&gt;&lt;a href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12."&gt;.&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You will need at least the second to latest version of macOS to use the latest version of XCode. Update your Mac &lt;a href="https://www.apple.com/macos/how-to-upgrade/"&gt;here&lt;/a&gt; if necessary.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;To avoid confusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The following steps are demonstrated with XCode 10 running on macOS Mojave. Depending on how far into the future you are, the interface may or may not look exactly the same.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/RrVzUOXldFe8M/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/RrVzUOXldFe8M/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Rules&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Anything circled in green means click.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Two green circles means double click.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Green arrow means click and drag.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anything circled in yellow means take a look.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Description text always refers to the image above.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Create new project&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZZwiG8Em--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A1MAu9_jKVnTaHvcE" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZZwiG8Em--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A1MAu9_jKVnTaHvcE" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Nh0NJ7IE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/731/0%2Adaz2umoRDynag73F" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Nh0NJ7IE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/731/0%2Adaz2umoRDynag73F" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--brabEzhy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/733/0%2Afqpl0oljAfOH3PQI" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--brabEzhy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/733/0%2Afqpl0oljAfOH3PQI" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For ‘Organization Name’ you could just put your name.&lt;/p&gt;

&lt;p&gt;For ‘Organization Identifier’ Apple wants a reverse domain identifier. That’s having ‘com.’ in the front instead of at the end like how we’re used to seeing it.&lt;/p&gt;

&lt;p&gt;You want to choose Swift because C++ is getting phased out for iOS development.&lt;/p&gt;

&lt;p&gt;We’re not doing any tests for the purposes of this app so uncheck all the boxes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PzYnSGhx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/799/0%2A1VLhYR7x5ANUuywz" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PzYnSGhx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/799/0%2A1VLhYR7x5ANUuywz" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Pause. Let’s take a look at some stuff.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kE1dmtML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ATbSLBpwV_xSS37-Z" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kE1dmtML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ATbSLBpwV_xSS37-Z" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The files that end with ‘.swift’ are your code files.&lt;/p&gt;

&lt;p&gt;The files that end with ‘.storyboard’ are your design files.&lt;/p&gt;

&lt;p&gt;The ‘Assets.xcassets’ folder contains all your media files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XHXjDb32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A0IxcnY_kYGHC2p8f" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XHXjDb32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A0IxcnY_kYGHC2p8f" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dgKWTXxG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Aku57AP5IsubIKj6t" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dgKWTXxG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Aku57AP5IsubIKj6t" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0VLvFiK7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AMgZSdMk-iUvZnyCJ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0VLvFiK7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AMgZSdMk-iUvZnyCJ" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can change the device that’s shown in your preview which directly affects the dimensions of the app that you build. I changed it from iPhone 8 to iPhone XR, but you can choose any device and still be able to follow along just fine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2j3n1Nwt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AVojJsTuvIElR-QCN" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2j3n1Nwt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AVojJsTuvIElR-QCN" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s close the view panel because you want to give yourself as much space to work with as possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;We’ll start designing your app now!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/QtSBfTT5TI3Go/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/QtSBfTT5TI3Go/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_1qw0b8U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AOAfqm2YHq0irv4ok" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_1qw0b8U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AOAfqm2YHq0irv4ok" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bRiiQSef--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AcXvccaZZFvkTGPKz" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bRiiQSef--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AcXvccaZZFvkTGPKz" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JJHJjMvg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A2VADSWxWx5Y0hEb0" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JJHJjMvg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A2VADSWxWx5Y0hEb0" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tr_eO-N4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A4ul8lriR8AgJsnaM" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tr_eO-N4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A4ul8lriR8AgJsnaM" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S75fivAb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AX4unHevz9VXtIDUT" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S75fivAb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AX4unHevz9VXtIDUT" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jkYhn6NQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ArPdlWdxFcoz4Po8M" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jkYhn6NQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ArPdlWdxFcoz4Po8M" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NNfC_Xxs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AObO_G6cKCjsD0b61" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NNfC_Xxs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AObO_G6cKCjsD0b61" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the font that calls to you most.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sEE9VmNx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A722-ly-Mfdkbnlla" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sEE9VmNx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A722-ly-Mfdkbnlla" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wMzzjaKa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AzU0INKBgSSy37uSs" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wMzzjaKa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AzU0INKBgSSy37uSs" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Zoom out a little if you don’t see the whole device.&lt;/p&gt;

&lt;p&gt;Recenter your label.&lt;/p&gt;

&lt;p&gt;Reopen the view panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y898WyTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AvbqZlBE2HNl5GLQC" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y898WyTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AvbqZlBE2HNl5GLQC" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PsSf9fdp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Ah4K9eZBxa3RkzJsw" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PsSf9fdp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Ah4K9eZBxa3RkzJsw" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose your background color. I used the color pencil option with Apple’s pre-made color selection, but you can choose any color through any method that you want. Take a minute to click around and play with the color panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/9vJJadIH58iqY/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/9vJJadIH58iqY/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Let’s add an image&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kBOD-TtY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A8ZcepcWJtX3Ykx1c" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kBOD-TtY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A8ZcepcWJtX3Ykx1c" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mPuJYg-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AH85mrH1MSPIDCGQU" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mPuJYg-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AH85mrH1MSPIDCGQU" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will need various sizes of the same image for different devices, but there’s a great website called &lt;a href="https://appicon.co/"&gt;appicon.co&lt;/a&gt; that can take care of resizing images for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GiZkiJLV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AJJnlaoqmBhyA3gxj" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GiZkiJLV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AJJnlaoqmBhyA3gxj" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1yOVPn9t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AR5-5oM27HboUtxeT" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1yOVPn9t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AR5-5oM27HboUtxeT" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vk-qlo78--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ADIWuEbeGXaf45hRV" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vk-qlo78--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2ADIWuEbeGXaf45hRV" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X7_Cfghy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A8C-crmMEiCxjtB4e" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X7_Cfghy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A8C-crmMEiCxjtB4e" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GvpVO6Zh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AhwlHUfvOa2THvebU" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GvpVO6Zh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AhwlHUfvOa2THvebU" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4wdYoXy1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Ak8ZUDBheToN8HuP8" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4wdYoXy1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2Ak8ZUDBheToN8HuP8" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--97DvnWq9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AijUIOG0qc1kx5S4I" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--97DvnWq9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AijUIOG0qc1kx5S4I" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N7RfPO6n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A6zBBC9WtwVa_1mjv" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N7RfPO6n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A6zBBC9WtwVa_1mjv" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Type the image name to locate your image.&lt;/p&gt;

&lt;p&gt;In the view panel, drag your image to be above your label so that it layers behind the label.&lt;/p&gt;

&lt;p&gt;In the preview screen, drag your image to where your label is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eSDyoUBA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AYHY6LaEExmD2nNMg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eSDyoUBA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AYHY6LaEExmD2nNMg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have a chalkboard behind your text, let’s change the text color to white.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9TARkGpo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AUltHQQu4sLduHEoi" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9TARkGpo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2AUltHQQu4sLduHEoi" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sometimes your image will be distorted by default (not in this case), you can change the behavior of your image through the ‘Content Mode’ attribute.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1wrcDcfE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A-SybAXn7ea8S8QjX" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1wrcDcfE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A-SybAXn7ea8S8QjX" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you want very specific positions for your images or labels (provided by a client or design team), you can use the ruler panel to input the desired location.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Time out.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I know you want to go from 0 to 100, but that’s it for this post. Take some time to familiarize yourself with all the panels we went through. It’s a lot of panels to look at and remember but…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/IqFH0yMll9wl2/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/IqFH0yMll9wl2/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congrats on taking your first step in becoming an iOS developer!&lt;/p&gt;

</description>
      <category>appdevelopment</category>
      <category>tutorial</category>
      <category>guidesandtutorials</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
