<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dan Stepanov on Medium]]></title>
        <description><![CDATA[Stories by Dan Stepanov on Medium]]></description>
        <link>https://medium.com/@danstepanov?source=rss-354e415182d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*m2e8ErtdnNxXCk0DtUg-KA.jpeg</url>
            <title>Stories by Dan Stepanov on Medium</title>
            <link>https://medium.com/@danstepanov?source=rss-354e415182d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 07:01:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danstepanov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Walking to Mordor: A Guide for Hobbits]]></title>
            <link>https://medium.com/@danstepanov/walking-to-mordor-a-guide-for-hobbits-87ce491b8b74?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/87ce491b8b74</guid>
            <category><![CDATA[lord-of-the-rings]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Thu, 25 May 2017 22:52:01 GMT</pubDate>
            <atom:updated>2017-05-25T22:52:01.335Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note</em>: This article was adapted from a paper I wrote in 2012, it’s probably riddled with syntax errors.</p><p>This guide is intended for hobbits, of all levels of experience and knowledge, who reside in Hobbiton who wish to destroy the One Ring. By following this guide, a hobbit will be able to optimally navigate himself from The Shire (Hobbiton) to Mt. Doom (Mordor) in order to destroy the One Ring of Power. Where relevant, this guide includes useful information on necessary waypoints. Pertinent data such as demographics and topography of specified regions can be found in the appendix.</p><p>The One Ring of Power was secretly forged by the Dark Lord Sauron in the forge of Mt. Doom during the Second Age. He created the ring and 19 others (given to 19 Kings) in an attempt to rule over all of Middle Earth. The One Ring can control all of the other rings which allowed Sauron to corrupt the rulers of Middle Earth. Sauron lost the One Ring during the War of the Last Alliance and for roughly 3000 years the ring corrupted all who wore it despite efforts to destroy it. In order to destroy Sauron, the One Ring must be destroyed. This guide assumes you currently possess this ring of power and that you intend to destroy it.</p><p><strong>Materials Needed</strong></p><ol><li>The One Ring of Power</li><li>At least 1 companion</li><li>Gandalf (Grey or White)</li><li>Food (i.e. Lembas bread)</li><li>Weapons</li><li>Toiletries (optional)</li><li>Star of Earendil (acquire in Lórien)</li><li>Tent/Shelter</li><li>Boat w/ paddles</li><li>Mule (optional)</li><li>First Aid kit</li><li>Clothing and/or armor</li></ol><p><strong>Conventions:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*1O2UNFhBtd3r_saEOtmFPg.png" /></figure><p><em>Notes</em> contain helpful suggestions related to the hobbit’s journey. Additionally, <em>notes</em> designate what information can be found in the appendix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /></figure><p>This symbol means <em>reader beware</em>. In this situation, the hobbit might bring harm to himself or others around him.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /></figure><p>This symbol indicates <em>danger</em>. In this situation, the hobbit is in imminent danger of death or worse.</p><p><strong>Path Alternatives</strong></p><p>This guide assumes that the hobbit intends to travel to Mordor by foot. Any use of teleportation or giant eagles shall not be considered. Additionally, this guide assumes that the hobbit in question cannot pass through the realm of Isengard.</p><p>Below is a map of Middle Earth displaying 3 different paths one can take to get to Mt. Doom from The Shire. The red line indicates a path filled with extremely dangerous obstacles and thus, should be avoided. The green path shows the most direct path; however, the hobbit would have to cross through Isengard in addition to traveling on main roads (a poor choice for a ring bearer). Main roads are unfavorable since the Nazgul will be pursuing the ring bearer. The yellow path is the optimal path given the circumstances and conditions described above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ufi-5WL23nKQ8JT09Kstw.png" /><figcaption>The Realm of Middle Earth</figcaption></figure><p><strong>Walking to Mordor</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Caution:</strong> One does not simply walk into Mordor.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning: </strong>The One Ring can easily corrupt a weak mind. You must not succumb to the ring’s temptations.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> Nazgul will try to kill you so that they may obtain the One Ring. Avoid main roads at all costs.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> For more information on the Nazgul, please see the appendix.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> At no point during your journey should you put on the Ring. If you do, Sauron will find you and swiftly kill you.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> For more information on Sauron, see the appendix.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Caution:</strong> Beware of any former hobbit-like beings that may have been corrupted by the Ring. They will behave irrationally.</figcaption></figure><ul><li><em>Step 1</em>: Begin at The Shire and travel east approximately 150 miles towards Bree. You will cross the Brandywine Bridge after about 50 miles.</li><li><em>Step 2</em>: Once in Bree, seek out the Prancing Pony in order to replenish food supplies and rest before the next stretch of the journey.</li><li><em>Step 3</em>: From Bree, continue east another 300 miles to the elven city of Rivendell. Here, seek out the advice of the king of the elves, Elrond. This is a great place to acquire some quality Lembas bread, a boat and perhaps a few companions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> Elrond will tell you that the safest way to get Mordor is via the River of Anduin. See the appendix for more information on Elrond.</figcaption></figure><ul><li><em>Step 4</em>: Upon the next sunrise, travel approximately 100 miles east to the Misty Mountains. Cross through the mountains, weather permitting.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Caution:</strong> The weather in the Misty Mountains can be treacherous. Beware of avalanches.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> If the weather presents no immediate danger, skip to step 8.</figcaption></figure><ul><li><em>Step 5</em>: In the event that the weather is not permitting, begin traveling south along the Misty Mountains until you reach the Mines of Moria (about 400 miles from Rivendell). Following the map provided, this is the undesirable path.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Caution:</strong> The Mines of Moria are filled with orcs and worse. Tread carefully.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more on orcs.</figcaption></figure><ul><li><em>Step 6</em>: At the west gates of Moria (Doors of Durin), speak the word “friend” and enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> ‘Friend’ in Elvish is ‘Mellon.’ See the appendix for more on the Elvish language.</figcaption></figure><ul><li><em>Step 7</em>: Once inside, follow the path to the eastern gate of Moria (Dimrill Gate)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> Avoid all orcs and trolls. Trolls, specifically, are very hard to kill.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more on trolls.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> <strong>DO NOT WAKE THE BALROG</strong>.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more details on the Balrog.</figcaption></figure><ul><li><em>Step 8</em>: Once you make it past the Misty Mountains, travel directly east until you hit the River of Anduin. Both paths maintain a distance of approximately 100 miles between the Misty Mountains and the River of Anduin.</li><li><em>Step 9</em>: Both paths lead the traveler through the forest realm of Lothlórien (Denoted on the map as “Lórien”). Stop here but be mindful of the elven culture for it is much different from hobbit culture.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for a comparison of hobbit and elven cultures.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> Acquire the Star of Earendil from Galadriel. See the appendix for more on both Galadriel and the Star of Earendil.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acdtLDYRx9PEDfqLsH3lew.png" /><figcaption>All of the paths leading to Mt. Doom in Mordor</figcaption></figure><ul><li><em>Step 10</em>: Upon sunrise, travel further south along the River of Anduin (by boat).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Caution:</strong> The Black Gate is an extremely dangerous place and is home to armies and the Mouth of Sauron. Avoid it at all costs.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> Any attempt to cross through the Black Gate will result in death or worse.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more on the Black Gate.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption>The Mouth of Sauron is an extremely powerful sorcerer. Avoid him at all costs.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more on the Mouth of Sauron.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> Skip to Step 14 if your chosen path is around Minas Morgul. See the appendix for more on Minas Morgul.</figcaption></figure><ul><li><em>Step 11</em>: Begin traveling by land once the Dead Marshes appear on your left hand side.</li><li><em>Step 12</em>: Travel east through the Dead Marshes approximately 150 miles until you reach the Black Gate.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> Any attempt to cross through the Black Gate will result in death or worse.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more on the Black Gate.</figcaption></figure><ul><li><em>Step 13</em>: Travel south along the Mountains of Shadow for approximately 150 miles until you reach Minas Morgul.</li><li><em>Step 14</em>: If you have skipped from step 10, abandon your boat after traveling roughly 500 miles on the River of Anduin and begin traveling west towards Minas Morgul.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> Minas Morgul is the home of the Witch King. Do not enter Minas Morgul, go around it.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*A2YKDv1c_UB7ULs1kl28rw.png" /><figcaption><strong>Note:</strong> See the appendix for more on the Witch King.</figcaption></figure><ul><li><em>Step 15</em>: Travel 50 miles west (around Minas Morgul) towards Mt. Doom.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Hsl71Lp9py2RPJxyju-_jA.png" /><figcaption><strong>Warning:</strong> At no point during your journey should you put on the RIng. If you do, Sauron will find you and kill you.</figcaption></figure><ul><li><em>Step 16</em>: Climb to Sammath Naur (“Cracks of Doom”) and throw the Ring into the fires of the volcano.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Cation:</strong> Beware of any former hobbit-like beings that have been corrupted by the Ring. They will bite off your finger, given the opportunity.</figcaption></figure><ul><li><em>Step 17</em>: Exit Mount Doom as soon as possible since it will, most likely, collapse around you. Congratulations, you have destroyed the One Ring of Power, vanquished Sauron, and you have brought peace to Middle Earth!</li><li><em>Step 18</em>: Travel home and write a book about your adventures…..or three.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ebu9v81cwlXBu2ehcBl3Og.png" /><figcaption><strong>Cation:</strong> Paper cuts are a serious concern. See the appendix for more on paper cuts.</figcaption></figure><p><strong>Appendix</strong></p><p><em>Balrog — </em>A Balrog is large demon which shrouds itself in fire and darkness. Once angelic beings, the Balrogs were corrupted by the evil Vala Melkor. The Balrog in the Mines of Moria wields a sword and a whip. Defeating a Balrog requires great power (i.e. a dragon).</p><p><em>Black Gate</em> — The Black Gate is the only entrance to the realm of Mordor. Any other entrance would be through a series of mountain ranges. The armies of Sauron use the Black Gate to exit and enter Mordor. The Gate is kept by the Mouth of Sauron.</p><p><em>Bree </em>— Bree is an ancient settlement of men. It is a city east of The Shire. Predominantly, men and hobbits populate Bree. The Prancing Pony is an Inn in the town.</p><p><em>Dead Marshes</em> — The Dead Marshes are an area to the northwest of Mordor. Many battles were fought in these marshes and, slowly, the marshes enveloped the dead bodies from these battles. Anyone who attempts to touch the bodies in the marshes will likely drown in them themselves.</p><p><em>Dimrill Gate</em> — Dimrill Gate is the eastern gate of Moria.</p><p><em>Doors of Durin</em> — The Doors of Durin are the western gates of Moria. The gate contains an inscription saying “Doors of Durin, Lord of Moria. Speak, friend, and enter” in Elvish.</p><p><em>Elrond </em>— Elrond is the “half-elf” Lord of Rivendell. He is the son of Earendil and Elwing. He is over 6000 years old.</p><p><em>Elven Culture</em> — Elves, unlike hobbits, are immortal. Hobbits eat significantly more than elves. Elven females tend to become healers while males become warriors and fight. Hobbits, on the other hand, are pacifists and do not fight. For the most part, hobbits drink and eat.</p><p><em>Elvish Language</em> — There are several forms of Elvish, the most popular being Sindarin or Grey-Elvish. Most of the Elves in the western region of Middle-Earth speak Sindarin. The language derives from Common Telerin.</p><p><em>Galadriel</em> — Galadriel is considered to be the greatest elven woman. She is known as the Lady of Light and has been described as the most beautiful elf in Middle Earth. She is the mother-in-law of Elrond and the grandmother of Arwen.</p><p><em>Lembas Bread</em> — Lembas is a special kind of elven bread which stays fresh for as long as it is kept within the leaves it is wrapped in. It is intended for long journeys.</p><p><em>Lothlórien </em>— Lothlórien is considered the fairest elven realm during the Third Age. It is located between the River of Anduin and the Misty Mountains. Galadriel, the greatest female elf, resides in Lothlórien.</p><p><em>Middle Earth</em> — Middle Earth is the world in which this journey takes place.</p><p><em>Minas Morgul</em> — Minas Morgul (once Minas Ithil) is home to the Nazgul and their lord, the Witch King. Minas Morgul is Sindarin for “The Tower of Dark Sorcery.”</p><p><em>Mines of Moria</em> — An enormous underground mine in the Misty Mountains. Moria was home to the dwarves known as the Longbeards.</p><p><em>Misty Mountains</em> — The Misty Mountains is an enormous mountain range (795 miles long) stretching from Mount Gundabad to Methedras.</p><p><em>Mordor </em>— Mordor is a realm in the southeastern region of Middle Earth. Sauron and his armies reside in Mordor. The realm is surrounded on all sides by mountains.</p><p><em>Mount Doom </em>— Mount Doom (Amon Amarth) is a volcano located in the realm of Mordor. The One Ring was forged, and can only be destroyed, in the Cracks of Doom (a chasm in Mt. Doom).</p><p><em>Mountains of Shadow</em> — The Mountains of Shadow is the western mountain range of the realm of Mordor. It is home to many Orcs. The north-most point of the mountains is the Black Gate.</p><p><em>Mouth of Sauron</em> — The Mouth of Sauron is a man who has served Sauron for most of his life (about 70 years) and has learned much sorcery. During this time, he forgot his own name. He is pure evil and commands the armies of Sauron.</p><p><em>Nazgul</em> — The Nazgul (Ringwraiths) are the former kings of men who succumbed to Sauron’s power when they were given rings of power. They achieved immortality by becoming wraiths and are servants bound to the power of the One Ring.</p><p><em>One Ring</em> — The One Ring is a ring of power forged in the Cracks of Doom by Sauron. The ring contains a mind of its own and much of Sauron’s power. The ring corrupts all who bear it. However, certain races are less susceptible to the corruption of the ring.</p><p><em>Orcs </em>— Orcs are relatively dim-witted beings who serve as soldiers for Sauron. They serve out of fear of their masters.</p><p><em>Paper Cuts</em> — Paper cuts are cuts received while handling paper. The cuts are normally slice wounds that can cut surprisingly deep. These cuts are extremely annoying.</p><p><em>Prancing Pony </em>— The Prancing Pony is an inn located in the center of the town of Bree. The servers are hobbits and the Inn permits logging.</p><p><em>Rivendell </em>— Rivendell is an elven realm to the east of the Misty Mountains. It was founded by Elrond in the Second Age. Rivendell serves largely as an outpost for the elves.</p><p><em>River of Anduin </em>— The River of Anduin is the largest river in Middle Earth. The river stretches from the Grey to the Mouths of Anduin.</p><p><em>Sammath Naur </em>— Also known as the Cracks of Doom, Sammath Naur is a chasm in Mt. Doom in which the One Ring was forged. The Cracks of Doom is the only place where the One Ring can be destroyed.</p><p><em>Sauron </em>— Sauron was originally an angelic spirit. However, he fell victim to Melkor’s corruption. In an attempt to gain full control of Middle Earth, Sauron forged 9 rings of power for the rulers of men, 3 for the elves, 7 for the dwarves, and 1 for himself. Sauron’s ring (The One Ring) could control all of the other rings. As a sacrifice, Sauron put part of his power into the ring. This way, when Sauron wore the ring, he was more powerful but when he did not have the ring, he was very weak. By destroying the One Ring, Sauron can be destroyed.</p><p><em>Shire</em> — Also known as Hobbiton, the Shire is the home to the hobbits. This realm is series of hills in which the hobbits built their homes. The Shire is located in the northeastern region of Middle Earth.</p><p><em>Star of Earendil </em>— The Star of Earendil is an artifact which is owned by Galadriel. In its holder’s darkest hour, it is fabled to provide light.</p><p><em>Trolls</em> — Trolls are large and stupid creatures who are considered to be completely evil. They turn to stone upon exposure to sunlight. For this reason, they tend to dwell in caves.</p><p><em>Witch King </em>— The Witch King of Angmar is the leader of the Nazgul. He was once a great king of men but he fell victim to the corrupting powers of his ring of power. He serves as a chief servant of Sauron and resides in Minas Morgul. His original name and background are unknown. It is prophesized that the Witch King will not die at the hand of a man.</p><p><strong>Troubleshooting/FAQs</strong></p><ul><li><em>Why can’t you just fly from the Shire to Mordor?</em></li></ul><p>The Nazgul can also fly. For this reason, it is unwise to use any means of flight in order to reach Mount Doom since you would most likely be intercepted.</p><ul><li><em>Why have hobbits take the ring if it is so powerful and dangerous?</em></li></ul><p>Hobbits, though distant relatives of men, are less pragmatic than men. Men are greedy by nature and focus much of their attention on the future. Elves are also very pragmatic by nature. Neither of these qualities allows one to withstand the corrupting powers of the ring. For this reason, a hobbit is the optimal choice for a long-term ring-bearer.</p><ul><li><em>Why must the One Ring be destroyed right now?</em></li></ul><p>Up until recently, Sauron was relatively inactive. He now has massive armies that are invading nearby realms. Both Rohan and Helm’s Deep have suffered the wrath of Sauron’s power. If Sauron were to acquire the One Ring, nothing would be able to stop him from conquering Middle Earth. For this reason, the One Ring must be destroyed as soon as possible.</p><ul><li><em>Has this journey ever been attempted? If so, why did they fail?</em></li></ul><p>The destruction of the ring has been attempted before. However, the ring bearer was a human who carried the One Ring from the Battle of Dagorlad to Mt. Doom and chose not to destroy it. Even in this short time, the ring easily corrupted this man.</p><ul><li><em>What’s Tatters?</em></li></ul><p>Potatoes, boil them, mash them, and stick them in a stew.</p><ul><li><em>What accommodations will a hobbit receive on this journey?</em></li></ul><p>For most of your journey, you will sleep in ditches and you will eat Lembas bread primarily. Though it is unlikely that you will maintain the standard hobbit regiment of 7 meals a day (breakfast, second breakfast, elevenses, lunch, afternoon tea, dinner, and supper), you will visit many new places which will provide you with a myriad of unique culinary experiences.</p><p><strong>Bibliography</strong></p><pre>Tolkien, J.R.R. <em>The Fellowship of the Ring</em>. New York: Ballantine, 1974. Print. Vol. 1 of <em>The Lord of the Rings</em>. 3 vols.</pre><pre>Tolkien, J.R.R. <em>The Two Towers</em>. New York: Ballantine, 1974. Print. Vol. 2 of <em>The Lord of the Rings</em>.  3 vols.</pre><pre>Tolkien, J.R.R. <em>The Return of the King</em>. New York: Ballantine, 1974. Print. Vol. 2 of <em>The Lord of the Rings</em>.  3 vols.</pre><pre>Kamb, Steve, ed. <em>Nerd Fitness</em>. Mike Bridgman, 23 July 2012. Web. 15 Nov. 2012.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87ce491b8b74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Not All Who Wander Are Lost…]]></title>
            <link>https://medium.com/@danstepanov/not-all-who-wander-are-lost-5229f620e52d?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5229f620e52d</guid>
            <category><![CDATA[digital-nomads]]></category>
            <category><![CDATA[hacker-paradise]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[silicon-valley]]></category>
            <category><![CDATA[travel]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Sun, 27 Nov 2016 18:04:22 GMT</pubDate>
            <atom:updated>2017-09-16T18:29:50.685Z</atom:updated>
            <content:encoded><![CDATA[<p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><p>About 24 hours ago, alongside some great friends, I began my last day as a 25-year-old with a sunrise hike up one of the volcanoes of Bali. Dressed in my signature <a href="http://hacker.fund/">red panda onesie</a>, I stumbled up the side of the mountain to watch the sun rise over the mountains. As we ascended the still-active volcano, I kept thinking of something that one of these great friends had said which was that communal struggles make up some of the greatest bonds in our lives. Although the struggle was very evident as we sweatily tripped through the darkness, I couldn’t help but feel extremely thankful for the opportunity to build bonds with these people, in particular. Once at the top, the view was breathtaking and well worth the struggle. Additionally, the natural hot springs that followed our descent were nothing short of serene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tUVWPKT-qEZgh2NThK6M8w.jpeg" /></figure><p>Over the last few months, I’ve been exploring Asia with a group called <a href="http://www.hackerparadise.org/">Hacker Paradise</a>. When I started this journey, I meant it to be something of a vacation. However, 3 months in, I’m getting the same gut feeling that I experienced when I first attended <a href="https://mhacks.org/">MHacks</a> at the University of Michigan as well as the same sense of wonder I experienced when I first visited Silicon Valley. With a simultaneous mix of excitement and anxiety, I am happy to announce that I won’t be coming home. Up until now, I only had one strong passion, <a href="http://paulgraham.com/good.html">building things that people want</a>, but now I’ve realized that another passion is collective exploration. The last couple of months have been filled with instances of both cultural and personal exploration and I’m nowhere near done with either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqbmDO7YbQhBzunmrtjUgg.jpeg" /></figure><p>Over the next 6 months, after a brief visit to the US (for the winter holidays), I’ll be packing up and heading to South America for several months. After these months, I have no idea what I’m doing but one thing is for certain, I will not stop building. Silicon Valley and the hacker community have shown me how powerful user-oriented and iterative development can be for any idea. Every day, I deeply miss Silicon Valley, its community, and the friends (more like family) that I have gained through this culture of creation. However, traveling is what feels right at the moment. I am extremely fortunate for the friends I’ve made, especially through hackathons and Hacker Paradise. I couldn’t ask for a better group of people to be surrounded by during the beginning of this new quarter of my life, thank you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*NXewubKDUyVKnzR794byAw.png" /></figure><p>An additional thank you goes out to the amazing people I work with at <a href="http://barefootcoders.com/">Barefoot Coders</a> for being so cooperative while I work remotely. I truly believe that we are building something amazing together and I feel extremely gifted to work with such talented individuals every day. A final and tremendous thank you goes out to everyone I’ve talked to about this including my friends and family who have been so supportive of this decision despite the distance it puts between us. I love you all very much and I can’t wait to see you all this holiday season.</p><p>I begin this next journey with two lines from an old poem in mind…</p><blockquote><em>“All that is gold does not glitter,<br>Not all those who wander are lost;”</em></blockquote><blockquote><em>- J. R. R. Tolkien</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5229f620e52d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: Using Interface Builder via XIBs (Xcode 7.2, Swift 2.1)]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-xibs-xcode-7-2-swift-2-1-4c72f529a8f4?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c72f529a8f4</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[interface-builder]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Wed, 10 Feb 2016 10:12:10 GMT</pubDate>
            <atom:updated>2017-09-16T18:28:42.672Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 2</h4><p><em>This is Part 2 of a 3 Part tutorial that follows Apple’s old “Your First iOS App” tutorial, but implements all of the user interface elements via XML Interface Builder (XIBs) using Swift. View </em><a href="https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-xibs-xcode-7-2-swift-2-1-695d2bf5e38d#.flfufgbpn"><em>Part 1</em></a><em> or check out </em><a href="https://github.com/danstepanov/FirstAppXIBSwift"><em>the complete code on Github</em></a><em>.</em></p><p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><p>The next step is to familiarize ourselves with and setup our XIB.</p><p><strong>1. Initial XIB Setup</strong></p><p>Go back to your MainViewController.swift file. Similar to the app delegate, this comes with some helpful methods to handle different points in the life cycle of the UIViewController class. It should look a little like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ee65088d6f8ff3d775fe47bf0d50882/href">https://medium.com/media/3ee65088d6f8ff3d775fe47bf0d50882/href</a></iframe><p>One of the important aspects of a good developer is clean code. Thus, you want to remove any code that you don’t utilize. In this case, go ahead and delete lines 10 through 26 as they aren’t relevant to this project.</p><p>A key benefit to using XIBs is that it gives us a great separation of our business logic (calling APIs, manipulating data, assigning data, etc) and our views (definition of views, view properties, and their layout). In regards to our <strong>MainViewController</strong>, everything that deals with our views will go in “MainViewController.xib” and everything else will be in our “MainViewController.swift” file.</p><p>For now, we only care about defining our text field’s view; that is, its properties and its layout. So let’s navigate to our “MainViewController.xib” using the right side menu (Navigator). Once here, you should something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SKNm83r476jpfDFMlHxGNA.png" /></figure><ul><li>Section 1 is our <strong>Navigator</strong>, you can use this to move between the other files in the project.</li><li>Section 2 is the <strong>Document Outline</strong>, it provides a simple hierarchal overview of what is in the current view.</li><li>Section 3 is our actual playground (the Interface Builder), our current <strong>view</strong>.</li><li>Section 4 contains our tools (<strong>Utilities</strong>) that we will use in conjunction with the current <strong>view</strong> to build our UI.</li></ul><p>When working with a XIB, we will spend most of our time in sections 3 and 4.</p><p>First things first, at the bottom of the main view, find this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*bhlrevDUbFlQawSPQ9X4rQ.png" /></figure><p>After clicking on it, change it to this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*WrF7soZ-Ojs3GVoNzSRfvw.png" /></figure><p>Once you’ve done that click the green circle to finalize the change. Your main view should change it’s size and should now look more like an iPhone.</p><p>This is not a necessary change but will provide us with a better understanding of what our view will look like when run on an actual device.</p><p>Your view should now look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nE9u9p-AARvrvLroe9Y0g.png" /></figure><p>Now we’re ready to work! We will now add elements to the user interface — a text field, a button, and a label.</p><p><strong>2. The Text Field</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*HBODecPu21cdiYgdnSvidg.png" /></figure><p>In the Utilities, find the Object Library, it looks like the image to the adjacent image. Now, use the bottom “Filter” search bar and begin typing “text field.”</p><p>You will see the only result should be “Text Field.” Drag and drop this item into our main view, closer to the top of the page.</p><p>Once it’s on the page, you can make it larger by simply clicking and dragging the frame. Your view should look like the one below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G0DOanDDtL65NQ4V-B01RQ.png" /></figure><p>You will also notice that once you drag the text field into the view, it appears as a sub-branch in the Document Outline titled “Round Style Text Field.” We now want to adjust the properties and the layout of the text field.</p><p>First we’ll adjust a property of the text field. Make sure the text field is selected. The area above the <strong>Object Library</strong> in the <strong>Attributes Inspector</strong> is where you can modify the text field properties. Find the “Alignment” property and set the alignment to center by clicking this button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*TZS8AJN3pOsLAbzhZrRq5A.png" /></figure><p>As simple as that, now you have centered the text in the text field! Feel free to play around with the other properties like text color, placeholder text, etc.</p><p>Now, we’re gonna move onto adding layout constraints in Interface Builder so that our text field is properly placed on the screen. Once again, make sure the text field is selected and now look for these 3 buttons at the bottom of the main view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/160/1*tCc6WEsM72wZ9U-f4CcETA.png" /></figure><p>From left to right, these buttons are as follows:</p><ul><li><strong>Align</strong> — Allows you to align various axes of the current view to axes of its parent view. (Think center align horizontal and center align vertical)</li><li><strong>Pin</strong> — Allows you to create a new constraint between the current view and another view.</li><li><strong>Resolve Auto Layout Issue</strong> — I cannot, in good faith, recommend that you ever hit this button. Once you hit this button and select an option, you potentially throw all logic and reason out the window. I would only recommend using this if you are familiar with AutoLayout in Interface Builder and how it resolves issues.</li></ul><p>We want to introduce 3 constraints using AutoLayout</p><ol><li>Align Vertical Center of Text Field with Vertical Center of its Parent (View)</li><li>Set the Top of the Text Field to be 10% of its Parent View’s height</li><li>Set the Width of the Text Field to be 90% of its Parent View’s width</li></ol><p>The numbered instruction sets below correspond to the numbered constraints above:</p><ol><li>Ensure the text field is selected and click the <strong>Align</strong> button. Next, check the box that says <strong>Horizontally Center in Container</strong> and click <strong>Add 1 Constraint</strong>. If any red lines show up, disregard them for now.</li></ol><ul><li>Red lines simply indicate that more constraints are required in order to properly layout the view.</li><li>Yellow lines indicate that the current view doesn’t match the current constraints</li><li>Blue lines indicate that the current view matches the constraints and that there are sufficient constraints to properly place the view</li></ul><p>2. Ensure the text field is selected and right-click the text field, hold and drag to the parent view. Let go and you should see this window appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*J-2vlb-LC0eorxRrE47odQ.png" /></figure><p>Go ahead and click <strong>Top Space to Container</strong>. However, this isn’t quite the constraint we want so we need to edit it. Click on the newly created vertical line that extends from the top of the text field to the top of the parent view. Now a window like this should appear on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*qNU1K8iQNaw-xwbErYjw4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*dKQdQHBIwlQMMsAWwXx2Ig.png" /></figure><p>Your <strong>constant</strong> may be different than mine but that shouldn’t matter. Change the values on your page to match the ones below. This creates a constraint (layout relationship) ensuring that the top of the text field is 10% (See <strong>Multiplier</strong>) of the height of the screen (See <strong>Second Item</strong>).</p><p>Additionally, ensure that the value for <strong>Constant</strong> is set to zero.</p><p>Once again some colored lines may appear on the main view but disregard them for now. We will deal with them once we have introduced all of our constraints.</p><p>3. For our last constraint, again, ensure the text field is selected in the main view. Once again, right-click the text field and drag out to the parent view. This time when you let go and the screen below appears, click <strong>Equal Widths</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*l2OJ4PYhwfH4D73T4DwCyA.png" /></figure><p>As before, this isn’t quite the constraint we wanted so we’re going to modify it a bit. You’ll notice that as you add constraints, they appear in the <strong>Document Outline</strong> under a parent group titled <strong>Constraints</strong>. Go ahead and click on our newly created constraint for the width (the only one with “width” in the name). When the constraint is expanded on the right hand side of your screen, change the value of <strong>Multiplier</strong> from 1 to 0.9.</p><p>Now, click back on to the text field and you should see quite a bit of yellow lines. You should also notice that a yellow arrow has appeared in the <strong>Document Outline</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*AUlHahaQbhgCeGjTPRW1DA.png" /></figure><p>Click on this yellow arrow and you will be taken to a screen that presents an overview of the layout conflicts. It will tell you what properties are expected to be versus what they currently are in the main view. There is also a yellow triangle on the right of this view. See below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*eU_95lHPTdnOfsI6NZxuwQ.png" /></figure><p>Mine looks like the following. To resolve the constraint issues, click on the yellow triangle. This will present you with several options. See below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-wAba-o8w6Ga8hKBly_tw.png" /></figure><p>The issue is that, using the constraints we created, we have defined where we want the text field to be but the text field in the main view doesn’t match those constraints.</p><p>Instead of forcing a decision, Xcode allows you to decide whether to update the main view to match your constraints or to have Xcode adjust your constraints to match what the main view currently looks like. In this case, we know our constraints are right so we will select <strong>Update frames</strong> and click <strong>Fix Misplacements</strong>. If you click back into the main view, you’ll notice a lot of blue lines now! You will learn to love blue lines.</p><p>If you run the app, you should now see the text field at the top of the screen. Clicking inside will bring up the keyboard and allow you to type. While the keyboard appears automatically, we have to add to code make it disappear ourselves.</p><p>The key is implementing a “delegate method” of the UITextField. Delegate methods are like helper functions for the objects in your application, and can sometimes help pass data between two classes. In order to implement the UITextFieldDelegate, we add it to the line containing our class definition in <strong>MainViewController.swift</strong></p><pre>class MainViewController: UIViewController, UITextFieldDelegate {</pre><p>And then we set <strong>MainViewController.swift</strong> as the delegate within our <strong>viewDidLoad</strong> method.</p><p>Right below <strong>super.viewDidLoad() line</strong>, add</p><pre>textField.delegate = self</pre><p>This lets the application know where to look for the implementation of the delegate methods, which in this case is inside Self — a reference to our <strong>MainViewController</strong> class.</p><p>Now that we implemented the text field delegate, the delegate method we need to dismiss the keyboard is called “textFieldShouldReturn.” This function is called every time the user presses the “return” button on the keyboard.</p><p>Information about a class’s delegate methods is in Apple’s documentation. You can find the “textFieldShouldReturn” method in the <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html">UITextFieldDelegate reference article</a>.</p><p>Since this is more business logic than view work, we will add it below the <strong>viewDidLoad</strong> method in <strong>MainViewController.swift</strong>:</p><pre>func textFieldShouldReturn(textField: UITextField!) -&gt; Bool {</pre><pre>}</pre><p>Dismiss the text field programmatically by adding the following lines:</p><pre>func textFieldShouldReturn(textField: UITextField) -&gt; Bool {</pre><pre>// Dismisses the Keyboard by making the text field resign<br>   // first responder<br>   textField.resignFirstResponder()<br>   <br>   // returns false. Instead of adding a line break, the text <br>   // field resigns<br>   return false<br>}</pre><p>However, we haven’t yet created a reference to our text field from the XIB. Xcode knows to add the text field upon building the app but in order to access and manipulate the text field from our .swift file, we need to create an <strong>IBOutlet</strong> linking the text field to our code. To do this, we will need to open the <strong>Assistant Editor</strong>. If you aren’t familiar with the <strong>Assistant Editor</strong>, it’s the middle button in this set of buttons at the top bar of Xcode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*WkDqb63odM4fD4xjCm6m1g.png" /><figcaption>The button with two circles is the Assistant Editor</figcaption></figure><p>If you haven’t already, navigate to the <strong>MainViewController.xib</strong> file and click the <strong>Assistant Editor</strong> button. Your view should now be split in two like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlhyosXvm6NMc6V6EFPTfQ.png" /></figure><p>To make room, go ahead and hide the <strong>Utilities</strong> by clicking the right-most button in this set at the top of the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*6_PylTxxkloh67M7FX_6vA.png" /></figure><p>And hide the <strong>Document Outline</strong> by clicking this button at the bottom of the XIB view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/1*dkkVwTPiUGRUrd6LgmIFJQ.png" /></figure><p>Now, Xcode will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zY93u73J-s1gbTuk-rDcQg.png" /></figure><p>Go ahead and right-click the text field in the XIB file and drag your cursor all the way over to the .swift file just above the <strong>viewDidLoad</strong> method. You should see this little window pop up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGfzP0JQTgdAtwehCJea4w.png" /></figure><p>Since this will be an Outlet, just go ahead and name this “textField” and click <strong>Connect</strong>. Now, you should see the error icon go away and, if you run the app, clicking on the text field pulls up the keyboard and the <strong>Return</strong> button dismisses the keyboard. Additionally, we can now directly manipulate our text field from the .swift file.</p><p>In the next part of this tutorial, we will add the Label and the Button.</p><p>Part 3 Coming Soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c72f529a8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: 100% Programmatically (Xcode 7.2, Swift 2.1)]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-xcode-7-2-swift-2-1-3929813fa87e?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3929813fa87e</guid>
            <category><![CDATA[programmatic]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Mon, 08 Feb 2016 08:13:58 GMT</pubDate>
            <atom:updated>2017-09-16T18:28:31.227Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 2</h4><p><em>This is Part 2 of a tutorial that follows Apple’s old “Your First iOS App” tutorial, but implements all of the user interface elements programmatically using Swift. View </em><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-xcode-7-2-swift-2-1-9946d09610c4#.sab2octed"><em>Part 1</em></a><em> or check out the </em><a href="https://github.com/danstepanov/FirstAppProgrammaticSwift"><em>complete code on Github</em></a><em>. This tutorial is ported from an Objective-C implementation by </em><a href="https://medium.com/u/8a95264b5c47"><em>Austin Louden</em></a><em>. If you prefer Objective-C, please see </em><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-updated-95951cb189c4#.v166aoal9"><em>Part 1</em></a><em> and </em><a href="https://medium.com/@austinlouden/your-first-ios-app-100-programmatically-ca333d14a64c#.1q6tsohfz"><em>Part 2</em></a><em> of that tutorial.</em></p><p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><p>The next step is to add elements to the user interface — a text field, a button, and a label.</p><p><strong>1. The Text Field</strong></p><p>Go back to your MainViewController.swift file. Similar to the app delegate, this comes with some helpful methods to handle different points in the life cycle of the UIViewController class. It should look a little like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ee65088d6f8ff3d775fe47bf0d50882/href">https://medium.com/media/3ee65088d6f8ff3d775fe47bf0d50882/href</a></iframe><p>One of the important aspects of a good developer is clean code. Thus, you want to remove any code that you don’t utilize. In this case, go ahead and delete lines 10 through 26 as they aren’t relevant to this project.</p><p>Now, to add our text field, we’re going to lazily instantiate an Apple-provided class called UITextField. Lazy instantiation simply means that the object is only created when it is required by the program rather than having all the objects of a page created as soon as the page is created.</p><p>Below the <strong>viewDidLoad</strong> method, add the following code:</p><pre>lazy var textField: UITextField! = {<br>    let view = UITextField()<br>    view.translatesAutoresizingMaskIntoConstraints = false<br>    view.borderStyle = .RoundedRect<br>    view.textAlignment = .Center<br>    <br>    return view<br>}()</pre><p>We set <strong>translatesAutoresizingMaskIntoConstraints</strong> to <strong>false</strong> in order to set our own custom constraints for the text field. Additionally, we set the <strong>borderStyle</strong> to <strong>RoundedRect</strong> to style the text field the way we want it.</p><p>Now, within the <strong>viewDidLoad</strong> method, which is executed immediately after the view is created and loaded on screen — add the following line to introduce your text field.</p><pre>view.addSubview(textField)</pre><p>Now that you have instantiated the text field, we need to tell it where to display on the screen. In order to do this, we will use a tool provided by Apple called AutoLayout.</p><p>Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views. For example, you can constrain a text field so that it is horizontally centered within a view and so that the text field’s top edge always remains 8 points below the view’s top. If the view’s size or position changes, the text field’s position automatically adjusts to match.</p><p>In order to introduce your AutoLayout code, we need to override some built-in Apple layout methods. In order to do so, add the following line to your <strong>viewDidLoad</strong> method:</p><pre>view.setNeedsUpdateConstraints()</pre><p>Now, add the following method to your <strong>MainViewController</strong> class:</p><pre>override func updateViewConstraints() {<br>    super.updateViewConstraints()<br>}</pre><p>The <strong>updateViewConstraints</strong> method is called when the view controller’s view needs to update its constraints. In order to add our own constraints, we override this method. Now, create a new method called <strong>textFieldConstraints</strong> under the <strong>updateViewConstraints</strong> and add the following constraints that will properly place our text field within our view.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a261eb65e13950850b5ee023d468cd4/href">https://medium.com/media/8a261eb65e13950850b5ee023d468cd4/href</a></iframe><p>Finally, add the following line to <strong>updateViewConstraints</strong> in order to call the layout code for our text field. Be sure to add it above the <strong>super.updateViewConstraints</strong> method.</p><pre>override func updateViewConstraints() {<br>    textFieldConstraints()<br>    super.updateViewConstraints()<br>}</pre><p>Your <strong>MainViewController</strong> class should now look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/949169a6daf16cb718a71858065714a9/href">https://medium.com/media/949169a6daf16cb718a71858065714a9/href</a></iframe><p>If you run the app, you should now see the text field at the top of the screen. Clicking inside will bring up the keyboard and allow you to type. While the keyboard appears automatically, we have to add to code make it disappear ourselves.</p><p>The key is implementing a “delegate method” of the UITextField. Delegate methods are like helper functions for the objects in your application, and can sometimes help pass data between two classes. The delegate method we need to dismiss the keyboard is called “textFieldShouldReturn”, a function that is called every time the user presses the “return” button on the keyboard.</p><p>Information about a class’s delegate methods is in Apple’s documentation. You can find the “textFieldShouldReturn” method in the <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html">UITextFieldDelegate reference article</a>.</p><p>Add it below your <strong>viewDidLoad</strong> method:</p><pre>func textFieldShouldReturn(textField: UITextField!) -&gt; Bool {</pre><pre>}</pre><p>Dismiss the text field programmatically by adding the following lines:</p><pre>func textFieldShouldReturn(textField: UITextField) -&gt; Bool {   </pre><pre>   // Dismisses the Keyboard by making the text field resign<br>   // first responder<br>   textField.resignFirstResponder()<br>   <br>   // returns false. Instead of adding a line break, the text <br>   // field resigns<br>   return false<br>}</pre><p>We need to do a few more things before this works. Go back to the <strong>viewDidLoad</strong> method where you added the text field. Right below <strong>super.viewDidLoad() line</strong>, add</p><pre>textField.delegate = self</pre><p>This lets the application know where to look for the implementation of the delegate methods, which in this case is inside Self — a reference to our <strong>MainViewController</strong> class.</p><p>The last thing we need to do is update the “MainViewController.swift” file. There, you’ll find the line:</p><pre>class MainViewController: UIViewController {</pre><p>Change it to:</p><pre>class MainViewController: UIViewController, UITextFieldDelegate {</pre><p>This tells the <strong>MainViewController</strong> that it implements delegate methods of a UITextField object. The <strong>MainViewController</strong> should now look like</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/949169a6daf16cb718a71858065714a9/href">https://medium.com/media/949169a6daf16cb718a71858065714a9/href</a></iframe><p>Run the app — pressing the return button should now dismiss the text field.</p><p><strong>2. The Button</strong></p><p>Now, add the button in the <strong>viewDidLoad</strong> method as well. Ensure that you add the button below the textField creation.</p><pre>view.addSubview(textField)<br>view.addSubview(button)</pre><p>Similarly, we’ll lazily instantiate the button. Add the following below the lazy instantiation of the text field.</p><pre>lazy var button: UIButton! = {<br>    let view = UIButton()<br>    view.translatesAutoresizingMaskIntoConstraints = false<br>    view.addTarget(self, action: &quot;buttonPressed&quot;, forControlEvents: .TouchDown)<br>    view.setTitle(&quot;Press Me!&quot;, forState: .Normal)<br>    view.backgroundColor = UIColor.blueColor()</pre><pre>    return view<br>}()</pre><p>This takes care of most of the button’s properties. The <strong>addTarget, action, forControlEvents</strong> method allows you to specify a function that’s called when the button is pressed. The target is the object to which the action message is sent — in this case, self. The action performed after the button is pressed is identical to what would happen if you called</p><pre>buttonPressed()</pre><p>Wrapped in quotes is the name of the function to be called when the button is pressed — we still need to implement this.</p><p>The control event specifies the type of interaction required to trigger the button. Apple’s “UIControlEventTouchDown” is the way to specify just a simple tap.</p><p>We also need to add the layout constraints for the button. Add a <strong>buttonConstraints</strong> method below the <strong>textFieldConstraints</strong> method</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08f5a262a63c3e0d53afc49cbeb84b95/href">https://medium.com/media/08f5a262a63c3e0d53afc49cbeb84b95/href</a></iframe><p>Additionally, add the method call to the <strong>updateViewConstraints</strong> method.</p><pre>override func updateViewConstraints() {<br>    textFieldConstraints()<br>    buttonConstraints()<br>    super.updateViewConstraints()<br>}</pre><p>Now we can create the shell of the <strong>buttonPressed</strong> function. We need to create the label before we can implement the full thing.</p><p>In between <strong>viewDidLoad</strong> and <strong>textFieldShouldReturn</strong>, create the <strong>buttonPressed</strong> method:</p><pre>func buttonPressed() {<br> <br>}</pre><p>We’ll come back to this after we create the label.</p><p><strong>3. The Label</strong></p><p>I’ve saved the easiest for last. We’ll create the label below <strong>view.addSubview(button)</strong> line in <strong>viewDidLoad</strong></p><pre>view.addSubview(textField)<br>view.addSubview(button)<br>view.addSubview(label)</pre><p>Now to lazily instantiate the label:</p><pre>lazy var label: UILabel! = {<br>    let view = UILabel()<br>    view.translatesAutoresizingMaskIntoConstraints = false<br>    view.text = “Hello World!”<br>    view.textAlignment = .Center<br>    <br>    return view<br>}()</pre><p>add a <strong>labelConstraints</strong> method below the <strong>textFieldConstraints</strong> method</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b9bde3a4be68ba337458bfdc182b309/href">https://medium.com/media/8b9bde3a4be68ba337458bfdc182b309/href</a></iframe><p>Finally, add the method call to the <strong>updateViewConstraints</strong> method.</p><pre>override func updateViewConstraints() {<br>    textFieldConstraints()<br>    buttonConstraints()<br>    labelConstraints()<br>    super.updateViewConstraints()<br>}</pre><p>Run the app, and you should see the familiar “Hello World!” above your button.</p><p><strong>4. Changing the Label Text</strong></p><p>Only one thing left to do. Since you’ve already created the shell of the button pressed method, we just have to add a line that sets the label text equal to the string in the text field. This is done with one line inside buttonPressed:</p><pre>func buttonPressed() {<br>    // Print Hello followed by the user inputed string<br>    // The exclamation point is added to unwrap the optional<br>    label.text = &quot;Hello, \(textField.text!)&quot;<br>}</pre><p>You can print a value within a string by adding</p><pre>\(yourValue)</pre><p>with your value in parenthesis. This is demonstrated in the <strong>buttonPressed</strong> method above.</p><p>That’s it! Run the app and try it out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3929813fa87e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: Using Interface Builder via Storyboards (Xcode 7.2, Swift 2.1)]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-storyboards-xcode-7-2-swift-2-1-8d6c99fbb618?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d6c99fbb618</guid>
            <category><![CDATA[storyboard]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Mon, 08 Feb 2016 02:17:20 GMT</pubDate>
            <atom:updated>2016-02-09T23:28:13.833Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1</h4><p>At the end of this tutorial, you will have an app that looks like the one on the left. Upon clicking on the text field at the top, the system-provided keyboard appears and the user may type in their name. The user may then dismiss the keyboard by clicking “Done.” Finally, when the user clicks “Hello,” the label displays “Hello,” followed by the user’s name.</p><p>The first step is to open Xcode and click on “Create a new Xcode project” In this tutorial, I am using version 7.2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SqlClaVYxhv-ZsEnQ0q-jQ.png" /></figure><p>We’re going to use a “Single View Application.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVcxRaRrxwRcT9POl5K4Bg.png" /></figure><p>Fill out the relevant fields. Depending on your preference, you may select a specific device. We will be using Swift here. Core Data is not required and not recommended for this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GK37eGx2mMjZRky4DyHTig.png" /></figure><p>Prior to saving your project to your computer, ensure that “Create Git repository on” is checked and “My Mac” is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytMd_oUhwcwW4_gViLwQFA.png" /></figure><p>By default, “Single View Application” is oriented towards using storyboards. Xcode creates some default files for us including “Main.storyboard” and “ViewController.swift.” With these files already hooked up, our app is ready to go.</p><p>If you click on the Run button in the top left, your application should build with a blank white screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*kgLUofr4ISywQ80XUhNT_A.jpeg" /></figure><p>This is all good and well but our application doesn’t show us anything.</p><p>However, we now have a view to modify both visually through our storyboard file and programmatically through our .swift file. In the next part of this tutorial, we’ll handle all of the on-screen elements.</p><p>Part 2 is coming soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d6c99fbb618" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: Getting Setup with Xcode]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-getting-setup-with-xcode-ca369318e178?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca369318e178</guid>
            <category><![CDATA[user-interface]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Mon, 08 Feb 2016 00:40:17 GMT</pubDate>
            <atom:updated>2017-09-16T18:28:19.724Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This tutorial is taken directly from </em><a href="https://developer.apple.com/library/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/#//apple_ref/doc/uid/TP40015214-CH2-SW1"><em>Apple’s Getting Started Tutorial</em></a><em>. It is intended to be the first step in a series of iOS tutorials (linked below).</em></p><p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><p>To develop iOS apps natively, you need a Mac computer (OS X 10.10 or later) running the latest version of Xcode. Xcode includes all the features you need to design, develop, and debug an app. Xcode also contains the iOS SDK, which extends Xcode to include the tools, compilers, and frameworks you need specifically for iOS development.</p><p>Download the latest version of Xcode (currently 7.2) on your Mac free from the App Store.</p><p><strong>To download the latest version of Xcode</strong></p><ol><li>Open the App Store app on your Mac (by default it’s in the Dock).</li><li>In the search field in the top-right corner, type <strong>Xcode</strong> and press the Return key.</li><li>The Xcode app shows up as the first search result.</li><li>Click Get and then click Install App.</li><li>Enter your Apple ID and password when prompted.</li><li>Xcode is downloaded into your <strong>/Applications</strong> directory.</li></ol><p>Once you have downloaded Xcode, you are now ready to begin building your first iOS application. If you’d like to jump right into building your first app, please continue to one of the following tutorials. Each tutorial will have you build out the same app; the difference, however, will be which tools you utilize for building out the user interface (UI). The UI will be what your users see, what your app visually looks like.</p><p>Xcode provides two options for building out your UI, programmatic and Interface Builder. Furthermore, Interface Builder allows two sub-options, storyboards and XML Interface Builder (XIBs). So really, that makes three options for UI development (programmatic, storyboards, and XIBs). There are numerous pros and cons to each option but I won’t go into that here. If you’d like to learn more about the differences, please see <a href="https://www.youtube.com/watch?v=aTpHLCUierA&amp;feature=youtu.be">my talk on Front End iOS Development at Blue Run Ventures</a>.</p><p>Additionally, Xcode let’s you build your app with up to 2 languages, Swift and Objective-C. You may develop exclusively using one language or using a mixture of both. For simplicity, each of the following tutorials uses only one language at a time.</p><p><em>Please Note: At MHacks Refactor, I will be advocating the use of Swift and XIBs, the first option below.</em></p><p><strong>Next Steps</strong>:</p><p><em>Interface Builder Options:</em></p><ol><li><a href="https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-xibs-xcode-7-2-swift-2-1-695d2bf5e38d#.uwzvxjfzg">Your First iOS App: Using Interface Builder via XIBs (Xcode 7.2, Swift 2.1)</a></li><li><a href="https://medium.com/p/8d6c99fbb618/edit">Your First iOS App: Using Interface Builder via Storyboards (Xcode 7.2, Swift 2.1)</a></li></ol><p><em>Programmatic Options:</em></p><ol><li><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-xcode-7-2-swift-2-1-9946d09610c4#.r7uovhp3h">Your First iOS App: 100% Programmatically (Xcode 7.2, Swift 2.1)</a></li><li><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-updated-95951cb189c4#.7uk5c3hno">Your First iOS App: 100% Programmatically (Xcode 7.2, Objective-C)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca369318e178" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: 100% Programmatically (Xcode 7.2, Swift 2.1)]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-xcode-7-2-swift-2-1-9946d09610c4?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9946d09610c4</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programmatic]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Sun, 07 Feb 2016 15:19:56 GMT</pubDate>
            <atom:updated>2017-09-16T18:28:03.822Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1</h4><p><em>This is Part 1 of a tutorial that follows Apple’s old “Your First iOS App” tutorial, but implements all of the user interface elements programmatically using Swift. View </em><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-xcode-7-2-swift-2-1-3929813fa87e#.8nrt6dk1k"><em>Part 2</em></a><em> or check out the </em><a href="https://github.com/danstepanov/FirstAppProgrammaticSwift"><em>complete code on Github</em></a><em>. This tutorial is ported from an Objective-C implementation by </em><a href="https://medium.com/u/8a95264b5c47"><em>Austin Louden</em></a><em>. If you prefer Objective-C, please see </em><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-updated-95951cb189c4#.v166aoal9"><em>Part 1</em></a><em> and </em><a href="https://medium.com/@austinlouden/your-first-ios-app-100-programmatically-ca333d14a64c#.1q6tsohfz"><em>Part 2</em></a><em> of that tutorial.</em></p><p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*KScTlp_2y5NuhXZLlx-afw@2x.png" /></figure><p>At the end of this tutorial, you will have an app that looks like the one on the left. Upon clicking on the text field at the top, the system-provided keyboard appears and the user may type in their name. The user may then dismiss the keyboard by clicking “Done.” Finally, when the user clicks “Hello,” the label displays “Hello,” followed by the user’s name.</p><p>The first step is to open Xcode and click on “Create a new Xcode project” In this tutorial, I am using version 7.2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SqlClaVYxhv-ZsEnQ0q-jQ.png" /></figure><p>We’re going to use a “Single View Application.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVcxRaRrxwRcT9POl5K4Bg.png" /></figure><p>Fill out the relevant fields. Depending on your preference, you may select a specific device. We will be using Swift here. Core Data is not required and not recommended for this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GK37eGx2mMjZRky4DyHTig.png" /></figure><p>Prior to saving your project to your computer, ensure that “Create Git repository on” is checked and “My Mac” is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytMd_oUhwcwW4_gViLwQFA.png" /></figure><p>By default, “Single View Application” is not oriented for programmatic user interface development. Xcode creates some default files that we don’t want. Let’s go ahead and delete “Main.storyboard” by selecting it and clicking “delete” on the keyboard. When prompted, select “Move to Trash” instead of “Remove Reference.” Additionally, let’s go ahead and delete “ViewController.swift.”</p><p>In order to truly rid ourselves of the storyboard world, we need to modify the “info.plist.” Expand the sub-folder titled “Supporting Files” by clicking on the adjacent triangle. Select the file within the “Supporting Files” folder titled “Info.plist.” Select the row with the text “Main storyboard file base name” and delete it by hitting your “delete” key.</p><p>Now that we are free of the oppressive shackles of the storyboard, navigate to the “AppDelegate.swift” file by clicking the file browser on the left side of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QM4mwHdu6FTujmMn0rS9-g.png" /></figure><p>The App Delegate file is your application’s way of communicating with the operating system, and includes several useful methods.</p><p>We’ll mostly be dealing with “application: UIApplication, didFinishLaunchingWithOptions launchOptions:”, which is called immediately after the application launches.</p><p>If you click on the Run button in the top left, your application should build with a blank white screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*IpDl5d34E0cDC5TzlBfKyw.png" /></figure><p>This is all good and well but our application doesn’t show us anything.</p><p>In order to begin building an app programmatically, we’ll need to introduce a ViewController class. Click ⌘N to create a new file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcuu7JwrfZBCCpuGRZttWQ.png" /></figure><p>In the “Source” under “iOS,” select Cocoa Touch Class and click “Next.”</p><p>You can choose the name of your class, but make sure to set it as a subclass of UIViewController below. I named mine “MainViewController”. The UIViewController is a fundamental class of iOS development, and is used to make and handle interaction with elements in the user interface. Ensure “Swift” is selected under “Language.” Click Next, and then Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5X676_KpibfbUCa2Kiglzw.png" /></figure><p>You’ll notice that a new file has appeared in the Navigator on the left, “MainViewController.swift.” This file will include both your user interface and business logic code for this tutorial. You’ll also notice that “MainViewController.swift” has some boilerplate code.</p><p>We’ll come back to that in a bit — for now, go back to your “AppDelegate.swift” file.</p><p>Firstly, let’s take a look at the “application: UIApplication, didFinishLaunchingWithOptions launchOptions:” method — we’ll want to add some code matching the snippet below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f37ca6034d8a797303b35f08fe67e4a9/href">https://medium.com/media/f37ca6034d8a797303b35f08fe67e4a9/href</a></iframe><p>Line 4 instantiates an object of the UIWindow class set to the bounds of the iPhone’s screen.</p><p>Line 7 instantiates an object of our MainViewController class called “mainViewController.”</p><p>Line 10 sets “viewController” as the window’s root view controller.</p><p>Finally, line 13 makes the window visible.</p><p>Running the app again should give you a white screen and now you have a view to modify programmatically. In the next part of this tutorial, we’ll handle all of the on-screen elements.</p><p><a href="https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-xcode-7-2-swift-2-1-3929813fa87e#.ila6h7lzu">Continue to Part 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9946d09610c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: Using Interface Builder via XIBs (Xcode 7.2, Swift 2.1)]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-xibs-xcode-7-2-swift-2-1-695d2bf5e38d?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/695d2bf5e38d</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[interface-builder]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Sun, 07 Feb 2016 14:54:55 GMT</pubDate>
            <atom:updated>2017-09-16T18:27:52.340Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1</h4><p><em>This is Part 1 of a 3 Part tutorial that follows Apple’s old “Your First iOS App” tutorial, but implements all of the user interface elements via XML Interface Builder (XIBs) using Swift. View </em><a href="https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-xibs-xcode-7-2-swift-2-1-4c72f529a8f4#.b7d9bypgd"><em>Part 2</em></a><em> or check out </em><a href="https://github.com/danstepanov/FirstAppXIBSwift"><em>the complete code on Github</em></a><em>.</em></p><p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*KScTlp_2y5NuhXZLlx-afw@2x.png" /></figure><p>At the end of this tutorial, you will have an app that looks like the one on the left. Upon clicking on the text field at the top, the system-provided keyboard appears and the user may type in their name. The user may then dismiss the keyboard by clicking “Done.” Finally, when the user clicks “Hello,” the label displays “Hello,” followed by the user’s name.</p><p>The first step is to open Xcode and click on “Create a new Xcode project” In this tutorial, I am using version 7.2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SqlClaVYxhv-ZsEnQ0q-jQ.png" /></figure><p>We’re going to use a “Single View Application.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVcxRaRrxwRcT9POl5K4Bg.png" /></figure><p>Fill out the relevant fields. Depending on your preference, you may select a specific device. We will be using Swift here. Core Data is not required and not recommended for this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GK37eGx2mMjZRky4DyHTig.png" /></figure><p>Prior to saving your project to your computer, ensure that “Create Git repository on” is checked and “My Mac” is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ytMd_oUhwcwW4_gViLwQFA.png" /></figure><p>By default, “Single View Application” is not oriented towards using xibs. Xcode creates some default files that we don’t want. Let’s go ahead and delete “Main.storyboard” by selecting it and clicking “delete” on the keyboard. When prompted, select “Move to Trash” instead of “Remove Reference.” Additionally, let’s go ahead and delete “ViewController.swift.”</p><p>In order to truly rid ourselves of the storyboard world, we need to modify the “info.plist.” Expand the sub-folder titled “Supporting Files” by clicking on the adjacent triangle. Select the file within the “Supporting Files” folder titled “Info.plist.” Select the row with the text “Main storyboard file base name” and delete it by hitting your “delete” key.</p><p>Now that we are free of the oppressive shackles of the storyboard, navigate to the “AppDelegate.swift” file by clicking the file browser on the left side of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QM4mwHdu6FTujmMn0rS9-g.png" /></figure><p>The App Delegate file is your application’s way of communicating with the operating system, and includes several useful methods.</p><p>We’ll mostly be dealing with “application: UIApplication, didFinishLaunchingWithOptions launchOptions:”, which is called immediately after the application launches.</p><p>If you click on the Run button in the top left, your application should build with a blank white screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*kgLUofr4ISywQ80XUhNT_A.jpeg" /></figure><p>This is all good and well but our application doesn’t show us anything.</p><p>In order to begin building an app with XIBs, we’ll need to introduce a ViewController class. Click ⌘N to create a new file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcuu7JwrfZBCCpuGRZttWQ.png" /></figure><p>In the “Source” under “iOS,” select Cocoa Touch Class and click “Next.”</p><p>You can choose the name of your class, but make sure to set it as a subclass of UIViewController below. I named mine “MainViewController”. The UIViewController is a fundamental class of iOS development, and is used to make and handle interaction with elements in the user interface. Ensure that “Also create XIB file.” Additionally, make sure “Swift” is selected under “Language.” Click Next, and then Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NG_5cnpJjyfwBcMP0rcbg.png" /></figure><p>You’ll notice that two files have appeared in the Navigator on the left, “MainViewController.swift” and “MainViewController.xib.” “MainViewController.swift” is the programmatic end of MainViewController while “MainViewController.xib” is it’s graphical user interface counterpart in which we can drag and drop user interface elements including layout constraints. You’ll also notice that “MainViewController.swift” has some boilerplate code.</p><p>We’ll come back to those in a bit — for now, go back to your “AppDelegate.swift” file.</p><p>Firstly, let’s take a look at the “application: UIApplication, didFinishLaunchingWithOptions launchOptions:” method — we’ll want to add some code matching the snippet below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f37ca6034d8a797303b35f08fe67e4a9/href">https://medium.com/media/f37ca6034d8a797303b35f08fe67e4a9/href</a></iframe><p>Line 4 instantiates an object of the UIWindow class set to the bounds of the iPhone’s screen.</p><p>Line 7 instantiates an object of our MainViewController class called “mainViewController.”</p><p>Line 10 sets “mainViewController” as the window’s root view controller.</p><p>Finally, line 13 makes the window visible.</p><p>Running the app again should give you a white screen and now you have a view to modify both visually through your XIB file and programmatically through your .swift file. In the next part of this tutorial, we’ll handle all of the on-screen elements.</p><p><a href="https://medium.com/@danstepanov/your-first-ios-app-using-interface-builder-via-xibs-xcode-7-2-swift-2-1-4c72f529a8f4#.b7d9bypgd">Continue to Part 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=695d2bf5e38d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First iOS App: 100% Programmatically (updated)]]></title>
            <link>https://medium.com/@danstepanov/your-first-ios-app-100-programmatically-updated-95951cb189c4?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/95951cb189c4</guid>
            <category><![CDATA[objective-c]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[programmatic]]></category>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Wed, 25 Mar 2015 09:30:34 GMT</pubDate>
            <atom:updated>2017-09-16T18:27:36.986Z</atom:updated>
            <content:encoded><![CDATA[<h2>Your First iOS App: 100% Programmatically (Xcode 7.2, Objective-C)</h2><h4>Part 1</h4><p><em>This is an updated version of a tutorial created by </em><a href="https://medium.com/u/8a95264b5c47"><em>Austin Louden</em></a><em>. This tutorial follows Apple’s old “Your First iOS App” tutorial, but implements all of the user interface elements programmatically in Xcode 7.2.</em></p><p><em>Austin was kind enough to create a two-part tutorial but part 1 is quite outdated. This article is simply an updated version of part 1 and still leads into Austin’s part 2 which can be found </em><a href="https://medium.com/@austinlouden/your-first-ios-app-100-programmatically-ca333d14a64c"><em>here</em></a><em>. As such, much of this article is paraphrased from his part 1.</em></p><p><em>To learn more about my work, </em><a href="http://danstepanov.com/"><em>visit my website</em></a><em>.</em></p><p>This tutorial is intended for developers transitioning to iOS that don’t want to deal with Storyboarding or Interface Builder. It implements the “Hello World” app from Apple’s documentation entirely in code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*sFMOpbLC4yMDLKw6vgiiRg.png" /></figure><p>At the end of this tutorial, you will have an app that looks like the one on the left. Upon clicking on the text field at the top, the system-provided keyboard appears and the user may type in their name. The user may then dismiss the keyboard by clicking “Done.” Finally, when the user clicks “Hello,” the label displays “Hello,” followed by the user’s name.</p><p>The first step is to open Xcode and click on “Create a new Xcode project” In this tutorial, I am using version 7.2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SqlClaVYxhv-ZsEnQ0q-jQ.png" /></figure><p>We’re going to use a “Single View Application.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*8qaqKXzcDjH-tFl-3SrJ0Q.png" /></figure><p>Fill out the relevant fields. Depending on your preference, you may select a specific device. We will be using Objective-C here. Core Data is not required for this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*ww0W6zCb-J4AZQUsX6SL_Q.png" /></figure><p>Prior to saving your project to your computer, ensure that “Create Git repository on” is checked and “My Mac” is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*GvMeAlvWE_PEUe2yY80Gmg.png" /></figure><p>By default, “Single View Application” is not programmatically oriented. Xcode creates some default files that we don’t want. Let’s go ahead and delete “Main.storyboard” by selecting it and clicking “delete” on the keyboard. When prompted, select “Move to Trash” instead of “Remove Reference.” Additionally, let’s go ahead and delete “ViewController.h” and “ViewController.m.”</p><p>In order to truly rid ourselves of the storyboard world, we need to modify the “info.plist.” Expand the sub-folder titled “Supporting Files” by clicking on the adjacent triangle. Select the file within the “Supporting Files” folder titled “Info.plist.” Select the row with the text “Main storyboard file base name” and delete it by hitting your “delete” key.</p><p>Now that we are free of the oppressive shackles of the storyboard, navigate to the AppDelegate.m file by clicking the file browser on the left side of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwUigiIktc-ip6bf1IUXHQ.png" /></figure><p>The App Delegate file is your application’s way of communicating with the operating system, and includes several useful methods.</p><p>We’ll mostly be dealing with “application didFinishLaunchingWithOptions”, which is called immediately after the application launches.</p><p>If you click on the Run button in the top left, your application should build with a blank white screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*h0_-572_xH-N6rSTNXaQfg.jpeg" /></figure><p>This is all good and well but our application doesn’t show us anything.</p><p>In order to begin building an app programmatically, we’ll need to introduce a ViewController class. Click ⌘N to create a new file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*JItRm-XgYmskkI8HFhomQA.png" /></figure><p>In the “Source” under “iOS,” select Cocoa Touch Class and click “Next.”</p><p>You can choose the name of your class, but make sure to set it as a subclass of UIViewController below. I named mine “MainViewController”. The UIViewController is a fundamental class of iOS development, and is used to make and handle interaction with elements in the user interface. Ensure “Objective-C” is selected under “Language.” Click Next, and then Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*T6QMHVRWQT8pgq2z0dIfmw.png" /></figure><p>You’ll notice that two files have appeared in the Navigator on the left, “MainViewController.h” and “MainViewController.m.” Each file has some boilerplate code.</p><p>We’ll come back to those in a bit — for now, go back to your AppDelegate.m file.</p><p>First, make sure to import your MainViewController class at the top of the AppDelegate.m file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b7eae8a55144e2c42f2e149a47eaee2/href">https://medium.com/media/0b7eae8a55144e2c42f2e149a47eaee2/href</a></iframe><p>Next, let’s take a look at the “application didFinishLaunching” method — we’ll want to add some code matching the one below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/345c9cbb783cea6a0c9bf9911cd1d401/href">https://medium.com/media/345c9cbb783cea6a0c9bf9911cd1d401/href</a></iframe><p>Line 3 instantiates an object of the UIWindow class set to the bounds of the iPhone’s screen.</p><p>Line 6 sets the background color of the window to white.</p><p>Line 8 instantiates an object of our MainViewController class called “viewController.”</p><p>Line 10 sets “viewController” as the window’s root view controller.</p><p>Finally, line 12 makes the window visible.</p><p>Running the app again should give you a white screen and now you have a view to modify programmatically. In the next part of this tutorial, we’ll handle all of the on-screen elements.</p><p>Part 2 of this tutorial is provided by <em>@austinlouden</em>. I hope you found this tutorial helpful in understanding programmatic iOS development.</p><p><a href="https://medium.com/on-coding/ca333d14a64c">Continue to Part 2</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95951cb189c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crowd-Sourced Hackathon Travel]]></title>
            <link>https://medium.com/@danstepanov/crowd-sourced-hackathon-travel-de6fdf1c7aaa?source=rss-354e415182d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/de6fdf1c7aaa</guid>
            <dc:creator><![CDATA[Dan Stepanov]]></dc:creator>
            <pubDate>Fri, 15 Aug 2014 06:24:56 GMT</pubDate>
            <atom:updated>2014-08-17T07:56:27.950Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hack the Travel</h3><p>Recently, I have had quite a few people reach out to me regarding my crowd-funding campaigns (<a href="http://www.gofundme.com/81mja0">LA Hacks</a> and <a href="http://tilt.tc/vBwx">YC Hacks</a>) that I have used to get to my last two hackathons. Usually, hackers, concerned about travel expenses to a specific hackathon, ask me to share some of my strategies in successfully funding flights up to $850. This post aims to shed light on some of my go-to strategies regarding crowd-funding and provide guidance to hackers who are interested in giving it a shot.</p><p>A major expense for most hackathon organizers is travel reimbursement. The only thing worse than the allocation is the distribution. Usually, a hacker will only receive the funds well after the hackathon and only if they submit a hack during the competition. Thus, hackers are often forced to cover transportation and cross their fingers hoping that the funds show up in their bank accounts soon after the event. Flights are a very popular means of transportation but it is important to be mindful of the alternatives.</p><p>Generally, you should only start a crowdfunding campaign as an absolute last resort. Take some time to explore the multitude of travel options available based on your given situation. <a href="http://mlh.io/">Major League Hacking</a> (MLH) provides busses for a multitude of hackathons from various locations so reach out to them and see if there is one near you! Additionally, car-pooling and trains can be utilized to reduce costs. If you still need funds then you may consider crowdsourcing.</p><p>As a last resort, I started a Go Fund Me campaign from my girlfriend’s couch to attend LA Hacks in the Spring of 2014. I did not receive sufficient funding and even pulling strings didn’t get me anywhere near the $850 plane ticket from State College to Los Angeles. After launching the campaign, I messaged the organizers saying that I probably wouldn&#39;t be able to make the event despite the invitation. Much to my surprise, five hours later I had booked my flight to Los Angeles and was as giddy as a schoolgirl! For the next few weeks, I began to be referred to as “the guy who crowdsourced his way to LA Hacks.”</p><p>I saw this as a fluke and continued applying to hackathons with the hopes that I would never have to deal with funding issues again. And then, a few months later, I was accepted to <a href="http://www.ycombinator.com/">Y-Combinator’s</a> (YC) hackathon, YC Hacks!</p><p>At first, I was extremely excited but then I realized I was basically broke and YC wasn&#39;t offering any travel reimbursement. After exploring every last option, I turned, once again to crowdsourcing, this time using <a href="https://www.tilt.com/">Tilt</a>. I included some new sponsor prize ideas and set a modest goal of $600. With a better understanding of when people donated the most to a campaign, I was able to raise $610 in four days! At this point I knew I was onto something.</p><p>Now, you may ask, how can I do this?! It’s a simple three-step process. Start by understanding that hackathon goers are a community. Everyone wants to share the magic of hackathons with people, especially if that means getting you to a hackathon. Next, create a campaign with the goal of giving back. This is very important! If you simply ask for money, you are no better than a bum but if you offer something in return, you can be part of a community. Finally, thank your supporters and remember to pay it forward. Technically speaking, do the following:</p><ol><li>Go to <a href="http://www.tilt.com/">www.tilt.com</a> and create an account, preferably by logging in with Facebook.</li><li>Click the “Create campaign” tab and select “Collect of Fundraise.”</li><li>Set the “minimum amount to tilt” and the “target amount.” Be sure to set “minimum amount to tilt” to $1 to ensure you get some money even if you don&#39;t reach your goal. The target amount should be your travel costs. Keep in mind, Tilt takes 2.5% of the money you raise so pick a target amount that includes this fee.</li><li>Select “Any amount is fine” and leave the next four bullet points empty.</li><li>Set an expiration date to approximately three weeks before your expected travel date to ensure that prices don&#39;t spike.</li><li>Create a captivating but simple “Title” for your campaign.</li><li>For the “Description,” you should introduce why you are crowd sourcing with about a paragraph and why this event is important to you. Following this paragraph, you should list multiple prizes for different amounts that people donate. Prizes may include teaching people to code, doing some basic freelance work, or something creative relating to your hack at the event. Remember, this is all about giving back!</li><li>Be sure to upload an image or a video to give your audience a visual representation of your campaign and so it stands out on social media.</li><li>Leave everything else as-is and hit “Create Campaign.”</li><li>Proceed to share this link on every single social media platform, in any groups you contribute heavily to, and especially with your family and friends! As you can see, my greatest contributors were relatives and friends. The most money is raised at the beginning and end of your campaign so be consistent with media posts and let people know if you are close! Encourage people to share your campaign if they can’t donate and definitely encourage those who donated to share. The more people that see your campaign, the better.</li><li>Finally, personally thank everyone that helped with your campaign even if you didn’t reach your target amount. They are all amazing people and they believe in you! Remember to pay it forward when you see a friend in need of a little help ☺</li></ol><p>Once again, I recommend exploring all options prior to considering crowdsourcing as an option. Try getting the hackathon organizers to match the amount you raise so you don’t need to ask for too much. I wish you all the best of luck and I hope this post helped you in determining what option is best for your case. Never stop building.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de6fdf1c7aaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>