<?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: Joshua Shinkle</title>
    <description>The latest articles on DEV Community by Joshua Shinkle (@joshuashinkle).</description>
    <link>https://dev.to/joshuashinkle</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%2F401938%2F57c88663-adbe-4743-a210-a40aacf151af.jpeg</url>
      <title>DEV Community: Joshua Shinkle</title>
      <link>https://dev.to/joshuashinkle</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joshuashinkle"/>
    <language>en</language>
    <item>
      <title>How to pass data between view controllers in swift</title>
      <dc:creator>Joshua Shinkle</dc:creator>
      <pubDate>Wed, 08 Jul 2020 13:54:54 +0000</pubDate>
      <link>https://dev.to/joshuashinkle/how-to-pass-data-between-view-controllers-in-swift-2jmk</link>
      <guid>https://dev.to/joshuashinkle/how-to-pass-data-between-view-controllers-in-swift-2jmk</guid>
      <description>&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;A month ago, I was working on an iOS app that used a realtime database in Firebase to more efficiently store, access, and utilize data inputted by a user.&lt;/p&gt;

&lt;p&gt;When storing and retrieving the user’s data, I needed to create a reference to my database.&lt;/p&gt;

&lt;p&gt;In order to successfully create the reference, I needed to know the correct child name in my database in Firebase. The child name wasn’t constant though, so I couldn’t hardcode it. &lt;/p&gt;

&lt;p&gt;I needed to assign the child name to a variable and pass the variable into my database reference.&lt;/p&gt;

&lt;p&gt;This is where the problem occurred...&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;For my project, I could only access the child name from my MainViewController and could only create my database reference in my SecondaryViewController. &lt;/p&gt;

&lt;p&gt;Accordingly, I would need to pass the name from my MainViewController to my SecondaryViewController. &lt;/p&gt;

&lt;p&gt;I researched several different methods and settled on using a segue to pass the child name between view controllers.&lt;/p&gt;

&lt;p&gt;Here’s how I did it...&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution
&lt;/h1&gt;

&lt;p&gt;First, in my MainViewController, I created a variable to access and store the child name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Second, in my SecondaryViewController, I created a variable for the child name. This is where the name would be stored when passed from the MainViewController to the SecondaryViewController.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Third, in my MainViewController, I defined the prepare(for:sender:) function which would be invoked before the segue between view controllers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;segue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;UIStoryboardSegue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;?)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Fourth, inside the prepare(for:sender:) function in my MainViewController, I used an if statement and optional casting to determine if the segue destination is the SecondaryViewController. I also defined a new variable called vc to give me access to my name variable in the SecondaryViewController.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;vc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;segue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt; &lt;span class="k"&gt;as?&lt;/span&gt; &lt;span class="kt"&gt;SecondaryViewController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Fifth, inside of the if statement in the MainViewController, I accessed the name variable in the SecondaryViewController and set it equal to the name variable in my MainViewController.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="n"&gt;vc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That’s all! I’ve found it to be a pretty simple and effective method. Here’s what the full code looked like:&lt;/p&gt;

&lt;p&gt;MainViewController:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
&lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;segue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;UIStoryboardSegue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;?)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;vc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;segue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt; &lt;span class="k"&gt;as?&lt;/span&gt; &lt;span class="kt"&gt;SecondaryViewController&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;vc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;SecondaryViewController:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  In Closing
&lt;/h1&gt;

&lt;p&gt;Here’s another resource I found helpful in learning to pass data between view controllers: &lt;a href="https://learnappmaking.com/pass-data-between-view-controllers-swift-how-to/"&gt;https://learnappmaking.com/pass-data-between-view-controllers-swift-how-to/&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The segue method worked for me but there might be a better way to do it! Leave a comment how you would attack this problem and let me know if you have an easier method!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>Miro: The Infinite Whiteboard</title>
      <dc:creator>Joshua Shinkle</dc:creator>
      <pubDate>Mon, 06 Jul 2020 14:52:59 +0000</pubDate>
      <link>https://dev.to/joshuashinkle/miro-the-infinite-whiteboard-56a5</link>
      <guid>https://dev.to/joshuashinkle/miro-the-infinite-whiteboard-56a5</guid>
      <description>&lt;h1&gt;
  
  
  Discovering Miro
&lt;/h1&gt;

&lt;p&gt;Several weeks ago, I began coding my summer computer science project: building an iOS social media app using swift and Firebase. &lt;/p&gt;

&lt;p&gt;I began planning and creating a schedule for my project. As I was working, my dad walked by my desk and suggested I use Miro to help my planning process. &lt;/p&gt;

&lt;p&gt;I had no idea what Miro was or what it did. My dad said his software engineering company uses it constantly.&lt;/p&gt;

&lt;p&gt;I was curious and decided to give Miro a try. It revolutionized my entire planning process.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Miro?
&lt;/h1&gt;

&lt;p&gt;If you are unfamiliar with Miro as I was several weeks ago, here’s a succinct description: Miro is a free, online, infinite whiteboard. &lt;/p&gt;

&lt;p&gt;A new, blank board can be created on Miro.com where it appears as a white, grid-filled, web page. &lt;/p&gt;

&lt;p&gt;Here you have access to a range of tools from sticky notes and text boxes to a large collection of framework and mind-mapping templates. &lt;/p&gt;

&lt;h1&gt;
  
  
  Why I Use Miro
&lt;/h1&gt;

&lt;p&gt;I am still new to Miro so, instead of boring you with all of its amazing features, I will simply tell you how I use it. &lt;/p&gt;

&lt;p&gt;I am an extremely organized person and some may even say OCD to an extent. &lt;/p&gt;

&lt;p&gt;Accordingly, Miro wonderfully met my need to be able to organize my thoughts on paper in the easiest and most powerful way possible. &lt;/p&gt;

&lt;h3&gt;
  
  
  Kanban Framework
&lt;/h3&gt;

&lt;p&gt;Currently, I use Miro primarily for the Kanban framework it provides. &lt;/p&gt;

&lt;p&gt;I use this for managing and scheduling the days in my week. It helps me clarify what I have done thus far, what I am currently working on, and what I will start next. &lt;/p&gt;

&lt;p&gt;For me, this framework is a life saver when it comes to staying on task and working efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Story Mapping
&lt;/h3&gt;

&lt;p&gt;Miro’s story mapping template is also another favorite of mine. I created an expansive story map complete with different releases and a backlog for my entire project. &lt;/p&gt;

&lt;p&gt;Through the story mapping template, I established the order for working through my project. &lt;/p&gt;

&lt;p&gt;It helped me break down the task of building an iOS social media app into smaller components. This prevented the panic stage I’ve come across in the past when jumping straight into a large project with no real direction. &lt;/p&gt;

&lt;p&gt;The story map also couples well with the Kanban framework. &lt;/p&gt;

&lt;p&gt;At the end of each week, I repopulate my Kanban framework for the next week’s work by moving the next-in-line assignments from my story map to the Kanban backlog. &lt;/p&gt;

&lt;h3&gt;
  
  
  Goal Tracking
&lt;/h3&gt;

&lt;p&gt;Miro also provides different visual tables. &lt;/p&gt;

&lt;p&gt;I am currently using one of these tables to establish and track my goals for my project this summer. &lt;/p&gt;

&lt;p&gt;I use the different rows and columns to list and  analyze my goals, revealing my true purpose in creating them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Tools
&lt;/h3&gt;

&lt;p&gt;I’ve also been utilizing the sticky notes tool which allows you to move around different colored sticky-note-looking text boxes. The sticky notes are perfect for when I want to quickly write down an idea or comment. &lt;/p&gt;

&lt;p&gt;Miro contains a pen tool as well to write and draw on the board. This helps me clarify a note or comment, demonstrate a relationship, or visualize a portion of my project. &lt;/p&gt;

&lt;p&gt;Additionally, Miro has a cool feature called frames, which I use to group and visually separate different elements and tools in my board.  &lt;/p&gt;

&lt;h1&gt;
  
  
  In Closing
&lt;/h1&gt;

&lt;p&gt;While most of these tools can be used in real life, I prefer Miro to the physical versions because the tools can fit in my computer screen instead of having to move around a huge whiteboard on my wall. &lt;/p&gt;

&lt;p&gt;The board is also infinitely large so the fear of running out of space is nonexistent. &lt;/p&gt;

&lt;p&gt;I am still new to Miro and haven’t come close to figuring everything out yet, but I’ve loved it so far! Please leave a comment telling me how you use Miro and what you like about it!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>Welcome to my blog!</title>
      <dc:creator>Joshua Shinkle</dc:creator>
      <pubDate>Thu, 04 Jun 2020 16:51:21 +0000</pubDate>
      <link>https://dev.to/joshuashinkle/welcome-to-my-blog-2cbo</link>
      <guid>https://dev.to/joshuashinkle/welcome-to-my-blog-2cbo</guid>
      <description>&lt;p&gt;Hello world! &lt;/p&gt;

&lt;p&gt;My name is Joshua Shinkle.&lt;/p&gt;

&lt;p&gt;I just graduated from New Palestine High School and I'm planning to major in Computer Science - Cybersecurity at Taylor University this fall.&lt;/p&gt;

&lt;p&gt;This is my blog where I will document my explorations and adventures in the realm of Computer Science!&lt;/p&gt;

&lt;p&gt;You can also find me on Twitter and Medium &lt;a class="mentioned-user" href="https://dev.to/joshuashinkle"&gt;@joshuashinkle&lt;/a&gt;
&lt;/p&gt;

</description>
      <category>programming</category>
      <category>computerscience</category>
      <category>coding</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
