<?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 Ricardo Hurla on Medium]]></title>
        <description><![CDATA[Stories by Ricardo Hurla on Medium]]></description>
        <link>https://medium.com/@rihurla?source=rss-e818a080d775------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Hx4tq6r49vOrGDCm.jpg</url>
            <title>Stories by Ricardo Hurla on Medium</title>
            <link>https://medium.com/@rihurla?source=rss-e818a080d775------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 22:14:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rihurla/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[Sketch App Design]]></title>
            <link>https://medium.com/@rihurla/sketch-app-design-afe1afcc9ef4?source=rss-e818a080d775------2</link>
            <guid isPermaLink="false">https://medium.com/p/afe1afcc9ef4</guid>
            <category><![CDATA[sketch]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Ricardo Hurla]]></dc:creator>
            <pubDate>Tue, 17 May 2016 14:55:31 GMT</pubDate>
            <atom:updated>2016-05-17T16:03:36.338Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sketch App Design - Recents</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h21vkZX4DKs3g18VLo41EQ.png" /></figure><p>You can find the link of my previous post here:</p><p><a href="https://medium.com/p/317aa9c7cee3">Get, Regex and Data</a></p><p>Today I&#39;ll start designing the app with Sketch, here is the link for download:</p><p><a href="http://www.sketchapp.com/">Sketch - Professional Digital Design for Mac</a></p><p>I&#39;ll start by creating a new Sketch file, and adding a Artboard on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*LkSQV7Xhkbc1nn0v9glR_w.png" /></figure><p>On the right-hand side I&#39;ll choose iPhone 6 option. Also, I&#39;ll create a new sketch file from template and choose iOS UI Design, so i can copy and paste the resources.</p><p>From the template I&#39;ll copy a navigation bar, a tab bar and a status bar into my new project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*HViRjRI7ug_hxFZ9TpJFuQ.png" /></figure><p>Now, I&#39;m going to start by editing the tab bar, to do so, I&#39;ll go inside this symbol, and once I&#39;m inside, I&#39;ll delete 2 of those items as the project just going to use 3. Then i will rename the items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJ0VG9Ishub0zwhuaDcERw.png" /></figure><p>To align those icons now, I&#39;ll select the icons and place them on the centre of the bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdWoC9PDZ7Evgrs3BzP5yA.png" /></figure><p>And then distribute them horizontally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sEITy0tF19miGFUOQh0Nw.png" /></figure><p>After that I&#39;ll snap the titles under the icons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZII9PaW23qrz1Mx47KC8A.png" /></figure><p>Now, I’ll select a color. As this app already exists, I’ll keep the same color.</p><p>Tip: This site have a nice flat colors for you to select.<br><a href="https://flatuicolors.com/">https://flatuicolors.com/</a></p><p>If you don’t want to create the icons yourself, this site can provide nice icons for almost every feature, you can buy then for a good price or give the credits to the author.<br><a href="http://www.flaticon.com/">http://www.flaticon.com/</a></p><p>With the icons selected, I&#39;ll place them on the tab bar symbol, replacing the blocks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BFSONnoQb2VxeuR95m8sA.png" /></figure><p>On the navigation bar, I&#39;ll remove the edit and back buttons, use the same colors and give it a title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*P7cvGxgugbvHNSzIjEE54Q.png" /></figure><p>That is the structure, I&#39;ll just give a light grey background on this now, because the cells are going to be white.</p><p>I&#39;ll create now, a custom cell.</p><p>This cell is going to have a Title for the number of the bus lane, a subtitle for the name of the bus lane, a image to represent the direction that the bus is going and finally a fav star, so the user can add the bus lane to the favorites.</p><p>I&#39;ll add a white rectangle, and inside that I&#39;ll add 2 text labels (one bold and other regular) and 2 images to the canvas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*dVOrTajHAfNzQgFfsTZX5A.png" /></figure><p>Then I&#39;ve duplicated the cell and changed the images, so i can have a example of a cell with both bus directions and with favorite active and inactive state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*UTTkXGSCgejEHl60zMtwLw.png" /></figure><p>I&#39;m going to reuse those cells for the search view as well.</p><p>Thats it for today!</p><p>On the next post, i will create the search and feed views using Sketch.</p><p>Thanks a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afe1afcc9ef4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get, Regex and Data]]></title>
            <link>https://medium.com/@rihurla/search-for-a-bus-lane-and-get-the-location-of-the-buses-on-it-317aa9c7cee3?source=rss-e818a080d775------2</link>
            <guid isPermaLink="false">https://medium.com/p/317aa9c7cee3</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Ricardo Hurla]]></dc:creator>
            <pubDate>Sat, 14 May 2016 11:01:01 GMT</pubDate>
            <atom:updated>2016-05-17T15:18:59.092Z</atom:updated>
            <content:encoded><![CDATA[<h3>Get, Regex and Data! Search for a bus lane and get the location of the buses on it - My First Swift App</h3><p>You can find the link of my previous post here:</p><p><a href="https://medium.com/p/5237eb24e4de">Constants, services manager and API authentication.</a></p><p>On the previous post, I&#39;ve created a class called Service manager, added some functions on it to authenticate the app with the API.</p><p>Today I’ll add other functions there, to search for a bus lane and get the bus location for the selected lane.</p><p>I’ll start by adding a function there called <strong>makeHttpGetRequest</strong> and this time the callback is going to return a JSON and a error string.</p><p><em>*JSON type is part of the SwiftyJSON pod.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*wXkft-eNRhxLbeI6pPhV8g.png" /></figure><p>Now, the <strong>searchForBus</strong> function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*AGq4DLNT2Cof6Ixvh038CA.png" /></figure><p>There is only one problem that need to be sorted before test this code. In Brazilian Portuguese, the words can have special characters like: Pompéia, Petrônio, Carrão; Since the search does not support this kind of characters, neither composed names like Itaim Bibi, I&#39;ll create a basic regex function to replace those words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*3EC1IeEvGf_HJUYvxE6oQA.png" /></figure><p>On this regex, I&#39;ll pass the text the user types, and if there any occurrences of those special characters, they going to be replaced, also, the request does not support space, that is being replaced on this method by the + sign, so if the user search for <strong>Itaim Bibi</strong> it will look like <strong>Itaim+Bibi </strong>on the request.<strong> </strong>The last treatment that this function will provide to the search term, is return the word in lower case, so on the end it will look like this <strong>itaim+bibi</strong>.</p><p>The final request URL should look like this:</p><pre>http://api.olhovivo.sptrans.com.br/v0/Linha/Buscar?termosBusca=itaim+bibi</pre><p>Now, it&#39;s time to test this code on the AppDelegate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*B6stFcAJKFfDlcQsDlVwiA.png" /></figure><p>First I&#39;m authenticating the app, after that I&#39;m calling the function to search for a bus, passing the term &quot;Itaim Bibi&quot;.</p><p>Here is one object from the result of this request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*SZdVSqaTw1kAgoELw9JbBg.png" /></figure><p>Great! Now i have the object that represents a bus lane.</p><p>Now, I&#39;ll create a function on the service manager that will get the position of all the buses on this lane, I&#39;m going to use the lane code represented on the return of the request by the integer &quot;CodigoLinha&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*4uKuxbWi5EjB3zUHLgeAfg.png" /></figure><p>I&#39;m casting the integer received to a string to make this a part of the request URL that I&#39;m creating on this function.</p><p>Let&#39;s test it on the AppDelegate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*a0xQDFY-OlxrNmvPT-MLpw.png" /></figure><p><strong>This code doesn&#39;t look good at all</strong>, but at least i was able to test all the requests and see that everything is working, I&#39;ve got the result i was expecting, and now i can delete those lines of code.</p><p>Here is the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*8H7hrI7Gdcb-Tigs1gLp9w.png" /></figure><p>There is the documentation for the API once again.</p><p><a href="http://www.sptrans.com.br/desenvolvedores/APIOlhoVivo/Documentacao.aspx?1#docApi-posicao">Área de Desenvolvedores SPTrans - GTFS</a></p><p>Unfortunately on this specific result, the documentation does not tell what those values are.</p><p>Let&#39;s try to guess:</p><p><strong>&quot;hr&quot;</strong> should be the time of the search or the time of the last update.</p><p><strong>&quot;vs&quot;</strong> should be the the array of bus locations</p><p><strong>&quot;p&quot;</strong> should be the stop code (not going to use that on this app)</p><p><strong>&quot;px&quot;</strong> and <strong>&quot;py&quot;</strong> should be the latitude and longitude</p><p><strong>&quot;a&quot;</strong> should be a flag saying if the bus is provided with accessibility</p><p>That&#39;s it for today!</p><p>On the next post it will be design, I&#39;ll prepare my Storyboard structure, add tab and navigation bars, choose colors and icons.</p><p>Thanks a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=317aa9c7cee3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Constants, services manager and API authentication.]]></title>
            <link>https://medium.com/@rihurla/constants-services-manager-and-api-authentication-5237eb24e4de?source=rss-e818a080d775------2</link>
            <guid isPermaLink="false">https://medium.com/p/5237eb24e4de</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Ricardo Hurla]]></dc:creator>
            <pubDate>Fri, 13 May 2016 11:01:00 GMT</pubDate>
            <atom:updated>2016-05-13T13:04:45.414Z</atom:updated>
            <content:encoded><![CDATA[<h3>Constants, services manager and API authentication - My First Swift App</h3><p>You can find the link of my previous post here:</p><p><a href="https://medium.com/p/80ebe7e58245">Creating project structure</a></p><p>Today I&#39;ll start by creating 2 files: Constants and ServiceManager</p><p>On the first one I’ll store the URL’s and essentials like the application token.</p><p>On Xcode, File&gt;New&gt;File</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*yvZEOCRE0jcR_dUkTGOccw.png" /></figure><p>Swift file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*E6go-F2D9JkH1Jy0U9EzQg.png" /></figure><p>Now, on the Constants file, i don’t need to import foundation, because this class is going to be used only to store text.</p><p>On the image below, you can see what i have inserted on this file, it may contains changes as i go through the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*Z9M6Wd3u0OwrRpL8sJUSLA.png" /></figure><p>Just a quick explanation about it’s contents.</p><p>I’ve registered the application on the SPTrans site, and got the token, consumer key and consumer secret.</p><p>On the documentation of their API, there are URL’s that i will use to make the requests.</p><p>My constants file is done for now. I&#39;ll move to the services manager.</p><p>So, same steps for the file creation, except this time I&#39;m going to import Foundation and SwiftyJSON.</p><p>This class will be a Singleton, to make this I&#39;ll start by declaring a &quot;opening&quot; for a class on this file, and them insert the shared instance line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*oMM0HTEP1QGj4kTqj0WSHw.png" /></figure><p>Here is a link if you want to learn more about singletons.</p><p><a href="https://developer.apple.com/library/ios/documentation/General/Conceptual/DevPedia-CocoaCore/Singleton.html">Singleton</a></p><p>After that, a NSURLSession must be started, this session is going to make the requests for me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*jIchYZCXooXDhCcNYNSahQ.png" /></figure><p>To make the authentication on SPTrans, i have to create a POST method with no parameters, this request is going to return the <strong>string “True”</strong> if authenticated. You can find the documentation in Brazilian Portuguese here.</p><p><a href="http://www.sptrans.com.br/desenvolvedores/APIOlhoVivo/Documentacao.aspx?1">Área de Desenvolvedores SPTrans - GTFS</a></p><p>I’ve prepared this function to receive parameters as well, but at this point I’m not really going to use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*bBbMSoaV5o5WLsdpLwDV8A.png" /></figure><p>Since the function that going to make the request is done, I&#39;m going to create now the function that is going to authenticate the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*3ecRSSSbdSW79Gmw_eMR0w.png" /></figure><p>On this function, a URLString is created by the concatenation of the URL&#39;s plus the application token, this information can be found at the constants file. If you print this &quot;let&quot;, it should look like this:</p><pre>http://api.olhovivo.sptrans.com.br/v0/Login/Autenticar?token=shuhiduhisudhasiudashudhaisudhuashduashdiuashduasnklascnda</pre><p>With this URL ready, i can call the function to make the request passing the URLString, as i don&#39;t need to pass a body parameter now, it will be nil.</p><p>The result of this request is going to arrive on the &quot;callback&quot; block.</p><p>Now, I&#39;ll test to check if everything is working.</p><p>On the AppDelegate:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FK1DBe7zUHQQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DK1DBe7zUHQQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FK1DBe7zUHQQ%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f3e5a000f80d87d79f44957503b9a7f/href">https://medium.com/media/4f3e5a000f80d87d79f44957503b9a7f/href</a></iframe><p>That&#39;s it for today.</p><p>On the next post, I&#39;ll create a GET request, use it to search for a bus lane and get the location of all the buses for the chosen lane.</p><p>Thanks a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5237eb24e4de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating project structure]]></title>
            <link>https://medium.com/@rihurla/my-first-swift-app-80ebe7e58245?source=rss-e818a080d775------2</link>
            <guid isPermaLink="false">https://medium.com/p/80ebe7e58245</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Ricardo Hurla]]></dc:creator>
            <pubDate>Wed, 11 May 2016 14:04:15 GMT</pubDate>
            <atom:updated>2016-05-12T16:19:18.573Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating project structure - My First Swift App</h3><p>If you want to check out the previous part of this series here is the link:</p><p><a href="https://medium.com/p/6c19e8673332">My first Swift App</a></p><p>Right, introduction made. Let’s get to it!</p><p>I&#39;ll start by creating a single view application on Xcode.</p><ul><li>File&gt;new&gt;Project</li><li>Selected Single View Application</li><li>Selected Swift as the main language</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBz6BXwQQ3-2Jg7kJ7mKKg.png" /></figure><p>That&#39;s it, project created.</p><p>Now, I&#39;m going to create a git repository.</p><ul><li><a href="https://github.com/">https://github.com/</a></li><li>Create a new repository</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*L-9-NAYXueCw6zHrnLDU2Q.png" /></figure><p>Using the terminal on the directory of the project:</p><pre>git init<br>git commit -m &quot;first commit&quot;<br>git remote add origin git@github.com:username/repo.git<br>git push -u origin master</pre><p>At this point, I&#39;ve created a .gitignore and added some temporary files like xcuserdata and .DS_Store on it.</p><p><a href="https://help.github.com/articles/ignoring-files/">Ignoring files - User Documentation</a></p><p>Now, let&#39;s start cocoapods.</p><pre>pod init</pre><p>After cocoapods is started on the project, it&#39;s time to add the first pod on the podfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*DN_-i9j_w0p9sHCWhci3fA.png" /></figure><p>Install the pod with this command:</p><pre>pod install</pre><p>Now, I&#39;ve created a development branch to start working.</p><pre>git checkout -b develop</pre><p>Here is a good introduction guide if you are having problems dealing with git branches, that&#39;s a nice way to organize it.</p><p><a href="https://datasift.github.io/gitflow/IntroducingGitFlow.html">Introducing GitFlow</a></p><p>Thats it! Project created, everything installed, ready to start coding! :)</p><p>On the next post, I&#39;ll be creating the services manager file and authenticate the app with the SPTrans API.</p><p>Thanks a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80ebe7e58245" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My first Swift App]]></title>
            <link>https://medium.com/@rihurla/my-first-swift-app-6c19e8673332?source=rss-e818a080d775------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c19e8673332</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ricardo Hurla]]></dc:creator>
            <pubDate>Wed, 11 May 2016 11:36:56 GMT</pubDate>
            <atom:updated>2016-05-12T13:49:08.644Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>My first Swift App - Introduction</strong></p><p>My name is <strong>Ricardo Hurla</strong>, I’ve been developing for iOS since 2013, worked in great places, with great people, and learned a lot from them.</p><p>I was born and raised in Brazil, but on the beginning of<br>this year (2016), I’ve moved to Belfast, Northern Ireland, where i work as a iOS Developer.</p><p>As this is a brand new experience for me (both writing a post and programming with Swift), I’ve decided to share it here, and maybe <br>help someone who want to start on the language or just show the steps of a simple app creation.</p><p>I’ve decided to re-create my app called BuZu using Swift. The first version is on AppStore and is written in Objective-C. It is an app for bus tracking in Sao Paulo, Brazil, and it uses a open API from SPTrans to get “real time” data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0VMBgn4B83kU_0S5be-u8Q.png" /><figcaption>First Version of the BuZu app : <a href="https://itunes.apple.com/us/app/buzu/id867888856?ls=1&amp;mt=8">https://itunes.apple.com/us/app/buzu/id867888856?ls=1&amp;mt=8</a></figcaption></figure><p>So, I&#39;ll be working on this app from now on and here I’m going to share my experience working with Swift for the first time.</p><p>I&#39;m going to go from creating a iOS app structure to publishing the app to the AppStore, passing trough app design, icon design, app store process and more.</p><p><strong>Let me begin</strong> by describing the tools I’m using on this project.</p><ul><li><strong>Sketch </strong>and<strong> Photoshop </strong>for app and icon design. <a href="http://www.sketchapp.com/">http://www.sketchapp.com</a>/</li><li><strong>Xcode</strong> for project development. <a href="https://developer.apple.com/xcode/download/">https://developer.apple.com/xcode/download/</a></li><li><strong>Github</strong> for repository.<br><a href="https://github.com/">https://github.com/</a></li><li><strong>Terminal</strong> and <strong>oh-my-zsh</strong> for git control.<br><a href="https://github.com/robbyrussell/oh-my-zsh">https://github.com/robbyrussell/oh-my-zsh</a></li><li><strong>CocoaPods</strong> to manage dependencies. <br><a href="https://cocoapods.org/">https://cocoapods.org/</a></li><li><strong>SwiftyJSON</strong> to parse the results received from the API.<br> <a href="https://github.com/SwiftyJSON/SwiftyJSON">https://github.com/SwiftyJSON/SwiftyJSON</a></li><li><strong>SPTrans</strong> API to retrieve data.<br><a href="http://www.sptrans.com.br/desenvolvedores/">http://www.sptrans.com.br/desenvolvedores/</a></li></ul><p><em>I’ve registered myself on SPTrans Website, and get from them a application token, consumer key and consumer secret.</em></p><p><em>I’ll be not using tests and UI tests on this project.</em></p><p>That&#39;s it for this post!</p><p>Soon, i will be posting the start the project with the first steps.</p><p>Thanks a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c19e8673332" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>