<?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 Wilson Balderrama on Medium]]></title>
        <description><![CDATA[Stories by Wilson Balderrama on Medium]]></description>
        <link>https://medium.com/@wilson.balderrama?source=rss-15294c9ab368------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Lj2hrgCXtIPgCJ_kQ33m-Q.jpeg</url>
            <title>Stories by Wilson Balderrama on Medium</title>
            <link>https://medium.com/@wilson.balderrama?source=rss-15294c9ab368------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:00:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wilson.balderrama/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[flatMap Method in Action — Swift 3]]></title>
            <link>https://medium.com/@wilson.balderrama/flatmap-method-in-action-swift-3-853a66f970bd?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/853a66f970bd</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Mon, 28 Nov 2016 01:06:54 GMT</pubDate>
            <atom:updated>2016-11-28T01:09:07.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*-I1DJkJvR-FudCnr66ZMKg.jpeg" /></figure><p>In this time we’re going to talk about the flatMap method.</p><p>But first let’s put in context.</p><p>Let’s say we have an array of arrays:</p><pre>var arrayOfArrays = [ [1, 1], [2, 2], [3, 3] ]</pre><p>and there is a challenge about multiplying by 2 its content and the result should look like this:</p><pre>// <strong>[ [2, 2], [4, 4], [6, 6] ]</strong></pre><p>One approach to solve this challenge could be using the map Array&#39;s method two times like this:</p><pre>// first iterating the array of arrays<br>arrayOfArrays.<strong>map</strong> { array in<br>  <br>  // and second iterating <br>  // the current array<br>  return array.<strong>map</strong> { integer in<br>    // multiplying its content by 2<br>    return integer * 2<br>  }</pre><pre>} // <strong>[ [2, 2], [4, 4], [6, 6] ]</strong></pre><p>Good, then there is a new challenge converting the <strong>multiplied</strong> array of arrays to only one array like this:</p><pre>// [ 2, 2, 4, 4, 6, 6 ]</pre><p>Fortunately Array’s structure has a method for this purpose that’s called joined, let&#39;s use it:</p><pre>var multipliedByTwo = arrayOfArrays.<strong>map</strong> { array in<br>   return array.<strong>map</strong> { integer in<br>     return integer * 2<br>   }<br>}</pre><pre>var flattened = Array(multipliedByTwo.<strong>joined</strong>())<br>print(flattened) // outputs: [ 2, 2, 4, 4, 6, 6 ]</pre><p>But actually Array’s structure has already a method that does these two things at the same time, mapping and flattening, yes that’s flatMap:</p><pre>var arrayOfArrays = [ [1, 1], [2, 2], [3, 3] ]</pre><pre>var flattenedArray = arrayOfArrays.<strong>flatMap</strong> { array in<br>  return array.<strong>map</strong> { integer in<br>    return integer * 2<br>  }<br>}</pre><pre>print(flattenedArray) // outputs: <strong>[ 2, 2, 4, 4, 6, 6 ]</strong></pre><p>Let’s see another example.</p><p>In fact if we were iterating an array, flatMap and map would behave similarly:</p><pre>let numbers: <strong>[Int]</strong> = [1, 2, 3]</pre><pre>let numbersMap = numbers.<strong>map</strong> { return $0 }<br>print(numbersMap) // [1, 2, 3]</pre><pre>let numbersFlatMap = numbers.<strong>flatMap</strong> { return $0 }<br>print(numbersFlatMap) // [1, 2, 3]</pre><p>But if we had an array of optionals, there would be a big difference:</p><pre>let numbers: <strong>[Int?]</strong> = [1, <strong>nil</strong>, 3]</pre><pre>let numbersMap = numbers.<strong>map</strong> { return $0 }<br>print(numbersMap) // <strong>[Optional(1), nil, Optional(3)]</strong></pre><pre>let numbersFlatMap = numbers.<strong>flatMap</strong> { return $0 }<br>print(numbersFlatMap) // <strong>[1, 3]</strong></pre><p>while <strong>map</strong> method practically doesn’t change anything on the numbersMap array result, flatMap does two things: first convert item’s type from Int? to Int and then removes the nil items on the resulting conversion numbersFlatMap, pretty neat.</p><p>Now let’s finish with a practical use of flatMap in the real world:</p><p>Let’s say we have a method called <a href="https://gist.github.com/wilsonbalderrama/e1ae8e9e3f590b828ee757f582c17eec">getJSON</a> which based on a url will get us an array of dictionaries from a server:</p><pre>let url = &quot;https://jsonplaceholder.typicode.com/users&quot;</pre><pre>getJSON(from: url) { (dictionaries: <strong>[Dictionary&lt;String, Any&gt;]?</strong>) in<br>  print(dictionaries)<br>  <strong>// outputs:</strong> <br>  <strong>//</strong>  <strong>Optional([ <br>  //    [&quot;name&quot;: Leanne Graham, &quot;id&quot;: 1], <br>  //    [..], <br>  //  ])</strong><br>}</pre><p>So we create a User structure to store this data:</p><pre>struct <strong>User</strong> {</pre><pre>  let id: Int<br>  let name: String<br>  let username: String</pre><pre>  <strong>init?</strong>(dictionary: Dictionary&lt;String: Any&gt;) {<br>    <strong>guard</strong> <br>      let id = dictionary[“id”] as? Int,<br>      let name = dictionary[“name”] as? String,<br>      let username = dictionary[“username”] as? String<br>    <strong>else</strong> {<br>      return nil<br>    }</pre><pre>    self.id = id<br>    self.name = name<br>    self.username = username<br>  }</pre><pre>}</pre><p>A classical approach to convert the data in an array of User type could be something like this:</p><pre>getJSON(from: url) { (dictionaries: <strong>[Dictionary&lt;String, Any&gt;]?</strong>) in<br>  if let dictionaries = dictionaries {<br>    var users = [User]()</pre><pre>    for dictionary in dictionaries {<br>      <strong>let user = User(dictionary: dictionary)</strong><br>      <br>      if let user = user {<br>        users.append(user)<br>      }<br>    }</pre><pre>    print(users) <br>    // [ <strong>User(id: 1, name: &quot;Leanne Graham&quot;, username: &quot;Bret&quot;), .. ]</strong></pre><pre>  }<br>}</pre><p>Bear in mind that when are creating a new User passing adictionary, it is possible that it could fail the initializaton and return a nil since we declared the init as a failable one.</p><pre>struct User {<strong><br>  </strong>// some code</pre><pre>  // failable initalizer<br>  <strong>init?</strong>(dictionary: Dictionary&lt;String: Any&gt;) {<br>    // some code<br>  }<br>}</pre><p>That’s why we verify that user is not nil before adding to the users array.</p><p>But there is another approach iterating the <strong>dictionaries</strong> using <strong>flatMap:</strong></p><pre>getJSON(from: url) { (dictionaries: <strong>[Dictionary&lt;String, Any&gt;]?</strong>) in<br>  if let dictionaries = dictionaries {<br>    var users = [User]()</pre><pre>   <strong> // Accepts a dictionary and return a User?</strong><br>    let closure: (Dictionary&lt;String, Any&gt;) -&gt; User?</pre><pre>    <strong>// Initializing the closure</strong><br>    closure = { dictionary in<br>      return User(dictionary: dictionary)<br>    }</pre><pre>    <strong>users</strong> = dictionaries.<strong>flatMap</strong>(closure)</pre><pre>    print(users) <br>    // [ <strong>User(id: 1, name: &quot;Leanne Graham&quot;, username: &quot;Bret&quot;), .. ]</strong></pre><pre>  }<br>}</pre><p>So flatMap will do three things:</p><ol><li>Of course iterate the dictionaries array to convert an array of User type</li><li>if a User is created without any issue , flatMap converts from User? to User type every element.</li><li>it filters the nil values because failable initializers (init?) could return nil</li></ol><p>AfterflatMap finishes, we have an array of [User].</p><p>To finish we can reduce the code even more, like this:</p><pre>getJSON(from: url) { (dictionaries: <strong>[Dictionary&lt;String, Any&gt;]?</strong>) in<br>  if let dictionaries = dictionaries {<br>    var users = [User]()</pre><pre><strong>    users</strong> = dictionaries.<strong>flatMap</strong>(<strong>User.init</strong>)</pre><pre>    print(users) <br>    // [ <strong>User(id: 1, name: &quot;Leanne Graham&quot;, username: &quot;Bret&quot;), .. ]</strong></pre><pre>  }<br>}</pre><p>if you see the code where we used a closure, its type was this:</p><pre>let closure: <strong>(Dictionary&lt;String, Any&gt;) -&gt; User?</strong></pre><pre>// code</pre><pre>users = dictionaries.flatMap(<strong>closure</strong>)</pre><p>Expects a <strong>Dictionary&lt;String, Any&gt; </strong>as an argument and returns a <strong>User?</strong></p><p>And if you see the initializer function of the User struct:</p><pre><strong>init?</strong>(dictionary: Dictionary&lt;String: Any&gt;) {<br>    // some code<br>}</pre><p>Expect a <strong>Dictionary&lt;String, Any&gt;</strong> as an argument<strong> </strong>and of course itsinit? function call will return a<strong> </strong>User?</p><p>So that’s why we passed User.init (which refers to User structure’s init function) to flatMap:</p><pre><strong>users</strong> = dictionaries.<strong>flatMap</strong>(<strong>User.init</strong>)</pre><p>We saw various examples of using flatMap method but some important points to remember are:</p><ul><li>when working with array of arrays, applying flatMap will do two things, mapping and flattening.</li><li>when working with arrays of optional types, flatMap will map, convert the optional types to non optional, and remove the nil values.</li></ul><p>And that’s it, hope you find this article helpful.</p><p>Thanks for reading me!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=853a66f970bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Closures in Swift 3? (Part 3)]]></title>
            <link>https://medium.com/@wilson.balderrama/what-are-closures-in-swift-3-part-3-ee57ea637a06?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee57ea637a06</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[closure]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Sun, 27 Nov 2016 02:14:17 GMT</pubDate>
            <atom:updated>2016-11-27T02:23:15.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*ydOe2BXTBejQzMbh9qHEug.jpeg" /></figure><p>Continuing with the <a href="https://medium.com/@wilson.balderrama/what-are-closures-in-swift-3-part-1-4c6aa80f97c6#.m3doq37ty">part 1</a>, <a href="https://medium.com/@wilson.balderrama/what-are-closures-in-swift-3-part-2-cd135486d924#.bcvpjesc2">part2</a>, this post is going to be the last one regarding Closures and we all know for sure that it can be written an entire book talking only about Closures so I’ve just touched barely the surface.</p><p>This time I’m going to talk about:</p><ul><li>Shorthand Argument Names</li><li>Trailing Closures</li></ul><h4>Shorthand Argument Names</h4><p>One way to iterate an array is using the <strong>forEach</strong> method that in the following example is going to print its content:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ce4afe62b5ec1fe60523d06b9d486fe/href">https://medium.com/media/3ce4afe62b5ec1fe60523d06b9d486fe/href</a></iframe><p>Closures have a feature that allows us to simplify our code that instead of having to access its values through arguments, we could access them using <em>Shorthand arguments names</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1416ffc8e02086339c0662fe66ba0af6/href">https://medium.com/media/1416ffc8e02086339c0662fe66ba0af6/href</a></iframe><p>You can notice that we have omitted the argument name number even the keyword in, and we are accessing the value provided by the closure through the name: $0 so that our code is reduced and we can concentrate in the most important part of the code.</p><p>So even if the closure had more arguments, the shorthand names would be distributed with $0, $1, $2, and so on, you get the idea.</p><h4>Trailing Closures</h4><p>Let’s say we have a function called findInteger (don’t worry the source code of the function is at the end) that’ll use an Integer array to search for an element based on a condition:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ab018a477b12230fb7b5f6bbd21f5b1/href">https://medium.com/media/7ab018a477b12230fb7b5f6bbd21f5b1/href</a></iframe><p>So in the above code we want to get the first number that satisfies the condition on the closure that is the number sever.</p><p>We can see that we are receiving a closure expression on the second argument but sometimes like in this case the expression becomes long and instead we can do this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9df61bc110684778e4cdbb6aac35fa1/href">https://medium.com/media/d9df61bc110684778e4cdbb6aac35fa1/href</a></iframe><p>The difference is that first we didn’t need to use the argument label closure as part of function call.</p><p>And second now the closure expression comes after the function call’s parentheses but it is still an argument of the function.</p><p>This way of simplification is called <strong>Trailing Closure.</strong></p><p>Let’s see another example.</p><p>This time we have a method called <strong>forEach</strong> (source code at the end) on <strong>Integer</strong>’s extension structure which will allows us to iterate digits on a number like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7dda064f059bc61e86f11adb9ede0d3e/href">https://medium.com/media/7dda064f059bc61e86f11adb9ede0d3e/href</a></iframe><p>The code is pretty much explanatory itself but the closure is something long.</p><p>Let’s apply some <strong>Trailing Closure</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/813a467e25f605a8d67c5d3d9752fd9e/href">https://medium.com/media/813a467e25f605a8d67c5d3d9752fd9e/href</a></iframe><p>So here as the last example (findInteger function) we didn’t put the argument label called closure and also didn’t include the parentheses.</p><p>if the closure expression is the only argument as which happens in the forEach method, then we can eliminate the function’s call parentheses too.</p><p><strong>Trailing closures</strong> come to the rescue when the closure expression is long.</p><p>And as I mentioned the source code of the methods used in the examples:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b895646bb2b4d5040abaacb6dc1712b1/href">https://medium.com/media/b895646bb2b4d5040abaacb6dc1712b1/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f6edc12a24f72eb9ff48311f5aa156a/href">https://medium.com/media/2f6edc12a24f72eb9ff48311f5aa156a/href</a></iframe><p>If you find useful the article please help me recommending clicking the green heart outline icon so that I can continue creating more articles, thank you so much!</p><p>I want to personally thank you guys <a href="https://medium.com/@bobleesj">Bob</a> and <a href="https://medium.com/@em3888">Victor</a> for motivating me to share my Swift stories to our awesome iOS community.</p><p>Thanks for reading me!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee57ea637a06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delegates And Closures]]></title>
            <link>https://medium.com/@wilson.balderrama/delegates-and-closures-6bb09adbe6a1?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bb09adbe6a1</guid>
            <category><![CDATA[closure]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[delegation]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Thu, 24 Nov 2016 03:33:25 GMT</pubDate>
            <atom:updated>2016-11-24T03:33:25.888Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post I will use the same example applying first Delegates and then Closures, let’s dive into it.</p><h3>Delegates</h3><p>Let’s suppose there is a client that wants to have a developer build his website:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc806803c65503219c647c9badbc6e65/href">https://medium.com/media/fc806803c65503219c647c9badbc6e65/href</a></iframe><p>So he decide to find a developer but someone told him that he’d better find a developer specialized on web development.</p><p>He thought: “if I hired a developer, he would need to prove me that he’s specialized on web stuff” and he saw convenient that the potential candidate should follow a protocol to know that he’s the right one:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32a2c3786a9e311ccb488e8e45169dd5/href">https://medium.com/media/32a2c3786a9e311ccb488e8e45169dd5/href</a></iframe><p>And in this way the client will feel confident that his website will be built by someone that knows his stuff.</p><p>So that the client will delegate the task to someone that follows a protocolWebDeveloper because this will ensure that the developer knows how to make websites:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26b37104cda47bb7f4da36ee88458b10/href">https://medium.com/media/26b37104cda47bb7f4da36ee88458b10/href</a></iframe><p>Then the client finally not only finds a Engineer also realizes that he’s specialized on web stuff and he follows the protocol WebDeveloper:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d608f483e4a760fdb133204e5edf2b92/href">https://medium.com/media/d608f483e4a760fdb133204e5edf2b92/href</a></iframe><p>He hires and delegates him to do the job:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be5062116b0ea75a279e59cbc8b1f84d/href">https://medium.com/media/be5062116b0ea75a279e59cbc8b1f84d/href</a></iframe><p>So you can see that the engineer is stored in the delegate variable and this variable only accepts a WebDeveloper type and because Engineer type conforms the WebDeveloper protocol, this is why this assignation is successful.</p><p>And finally client calls his haveDeveloperBuildMyWebsite method that internally calls delegate?.makeWebsite.</p><h3>Closures</h3><p>Continuing with the example of above.</p><p>It happened to be that the client didn’t like the job and also he spent too much money on it.</p><p>After much thought he decided to try again working with another person but this time he didn’t want to spend too much money.</p><p>So he lowers his expectations and decides that as long as the person has the skills, the person could be hired.</p><p>But this time the client is only interested on the person’s ability to make websites, so he uses a closure for storing the person’s ability.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2af01a52b193dab6071523fe3a8b57dd/href">https://medium.com/media/2af01a52b193dab6071523fe3a8b57dd/href</a></iframe><p>A little while after, he hires another person:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed263db4a54ecfe8eeeb785d9f8c599d/href">https://medium.com/media/ed263db4a54ecfe8eeeb785d9f8c599d/href</a></iframe><p>And instead of requiring to store the enthusiast as a delegate, the client only store enthusiast’s makeWebsite method as a closure to make his website.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ff96b1c32a5063698f8ea12df49aa6c/href">https://medium.com/media/5ff96b1c32a5063698f8ea12df49aa6c/href</a></iframe><p>At the end the client will call the closure from haveDeveloperBuildMyWebsite method, and the closure is referring to enthusiast’s makeWebsite instance to finally have his website develop.</p><p>We could see the use of Delegates and Closures in this example, certainly both of them allows us to run code that belongs to another source behind another entity.</p><p>It will depend on the specific situation which approach fits better on the problem but in my humble opinion I think when more than one method is required, a <strong>Delegate</strong> will be a better option and on the other hand if one only one method is required, then a <strong>Closure</strong> should be a good solution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bb09adbe6a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Closures in Swift 3? (Part 2)]]></title>
            <link>https://medium.com/@wilson.balderrama/what-are-closures-in-swift-3-part-2-cd135486d924?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd135486d924</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[closure]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Tue, 22 Nov 2016 01:36:07 GMT</pubDate>
            <atom:updated>2016-11-22T01:36:07.984Z</atom:updated>
            <content:encoded><![CDATA[<p>In the last <a href="https://medium.com/@wilson.balderrama/what-are-closures-in-swift-3-part-1-4c6aa80f97c6#.n7bwltf98df">post</a> I wrote about what closures are and some use of them now I want to cover about some important characteristics of closures and these are:</p><ul><li><strong>Inferring Type from Context</strong></li><li><strong>Implicit Return from Single-Expression Closures</strong></li></ul><p>Let’s tackle one at a time.</p><p><strong>Inferring Type from Context</strong></p><p>We have this function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8f7fb9291b2bac3d3eb423da65f96f4/href">https://medium.com/media/e8f7fb9291b2bac3d3eb423da65f96f4/href</a></iframe><p>sayHello method accepts a String and a Closure on its parameters and we call it in this way:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/892e1d9c550ec08ac9187fac7eb4de21/href">https://medium.com/media/892e1d9c550ec08ac9187fac7eb4de21/href</a></iframe><p>But since it is already known that the type expected of the Closure argument will be (String) -&gt; Void, we could only remove the types of the argument and the type of return like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dd949cc8608226ad79b73289f0854f8/href">https://medium.com/media/9dd949cc8608226ad79b73289f0854f8/href</a></iframe><p>You see the difference? We removed the type String of person and also the returning type it happens to be Void.</p><p><strong>Implicit Return from Single-Expression Closures</strong></p><p>In the following code I’m filtering the zeros from the array.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9deba42bf142df23e0f97adc2af5658a/href">https://medium.com/media/9deba42bf142df23e0f97adc2af5658a/href</a></iframe><p>Swift allows us to remove the keyword return when we have a single expression like in the example above, we’re only doing a single thing that’s returning something.</p><p>And Swift already knows that the returning type of the closure will be a Bool, filter method expects a Closure like (Int) -&gt; Bool, and the call is reduced like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c85d3d61a00c19485bcf737d02c9b5cb/href">https://medium.com/media/c85d3d61a00c19485bcf737d02c9b5cb/href</a></iframe><p>Hope you find it useful this quick view of Closures so there will be a last post about some other characteristics of Closures that I saw are important but I will reserve that for another post.</p><p>Thanks for reading me!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd135486d924" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First iOS Open Source Project]]></title>
            <link>https://medium.com/@wilson.balderrama/my-first-ios-open-source-project-d1a6fbe3ad26?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1a6fbe3ad26</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Fri, 18 Nov 2016 00:52:16 GMT</pubDate>
            <atom:updated>2016-11-18T01:37:14.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*FmBr7_5uejQ4-AzPwwjXgw.png" /></figure><p>This is the first time where I am exposed to the community with my code style I feel a little nervous and excited at the same time.</p><p>I know that my code isn’t perfect but I also know too that in order to grow, you need to be sometimes in uncomfortable situations, anyways.</p><p>And also to be honest I don’t know where I’m getting into as long as iOS/Swift is present I feel like I’m going to the right direction.</p><p>When I find myself working on iOS projects sometimes I’m in the situation of getting some data from a server and only after having this data immediately I will need to hit another endpoint to get another stuff.</p><p>So that meant that I had to call to a asynchronous function and inside of its completion closure and only then I had to nest another asynchronous call, yes, I knew something wasn’t right there.</p><p>In my previous job I used to work as a Node.JS backend developer, so I knew that nesting asynchronous calls was a bad practice that even people on the JavaScript world have a name for it as <a href="http://callbackhell.com/">callback hell</a>.</p><p>And there is a great library called <a href="https://github.com/caolan/async">async</a> that one could use it in order to prevent this bad practice in Node.JS/JavaScript (of course this is not the only alternative, they have promises, generators, etc)</p><p>But I’m not in the JavaScript world, I am in the amazing iOS world!.</p><p>So I thought little bit about how I could deal with this situation in Swift, I saw that there are some great frameworks like <a href="https://github.com/ReactiveX/RxSwift">RxSwift</a> or <a href="https://github.com/FutureKit/FutureKit">FutureKit</a> that could help me with my problem but it felt like they are too advanced for my simple problem.</p><p>That’s why I created this <a href="https://medium.com/@wilson.balderrama/how-to-make-a-async-calls-in-serial-in-swift-3-1debc21ff3c4#.pz8jsgqop">blog post</a> trying to give a simple solution to my simple problem.</p><p>And I have to say my solution was biased and was so identical to <a href="https://github.com/caolan/async">async</a> and it was fine as long as my problem is solved right?</p><p>I was in the situation that I was constantly copying my solution to other projects so that’s why I decided to make it available as a library in central place like Github.</p><p>This is how I ended up creating this library called <a href="https://github.com/wilsonbalderrama/Ax">Ax</a> with my initial purpose of having my solution available for my other projects but I suspect that I’m not the only one who can be exposed to this problem of nested async calls in Swift.</p><p>And if you are interested in collaborate in the <a href="https://github.com/wilsonbalderrama/Ax">Ax</a> library, please feel free to contact me, I plan to implement more functionality.</p><p>So I’d like to talk about the process of how I created/uploaded my library in Github and made it available in cocoapods but that could be for another post, let me know if you are interested, I’d like to share it.</p><p>Thanks for reading me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1a6fbe3ad26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Closures in Swift 3? (Part 1)]]></title>
            <link>https://medium.com/@wilson.balderrama/what-are-closures-in-swift-3-part-1-4c6aa80f97c6?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c6aa80f97c6</guid>
            <category><![CDATA[closure]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[function]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Wed, 28 Sep 2016 14:58:22 GMT</pubDate>
            <atom:updated>2016-09-28T14:59:52.204Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Closures</strong> are independent blocks of functionality that can be passed around and used in your code.</p><p>The <strong>structure</strong> of a <strong>Closure</strong> is like the following:</p><pre>{ (parameters..) -&gt; return type in <br>  // code<br>}</pre><p><strong>A really important aspect is that every closure has a type.</strong></p><p>Let’s see some use of them in code, we have a function called <strong>sayHello </strong>which accepts as parameters a <strong>String</strong> and a <strong>Closure, </strong>the only labor<strong> sayHello function </strong>does is call the closure with its argument String.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5256eb439eb10c2ac34d8c8486b59177/href">https://medium.com/media/5256eb439eb10c2ac34d8c8486b59177/href</a></iframe><p>Now let’s create the closure and one thing to notice is that <strong>sayHello function </strong>expects a closure whose <strong>type</strong> is <strong>(String) -&gt; Void </strong>that means that the closure needs to be constructed according this type: accepts only one parameter with <strong>String type</strong> and return <strong>Void</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25450716ab9dcdc25a089d6503df8e84/href">https://medium.com/media/25450716ab9dcdc25a089d6503df8e84/href</a></iframe><p>In the above code we have created a <strong>constant</strong> called <strong>myClosure </strong>that will hold the independent block of functionality which accepts a <strong>String</strong> and returns <strong>Void</strong> and print a message concatenating the <strong>person</strong> <strong>String</strong> passed by.</p><p>So now that we have all the code set up in place let’s use them, we call <strong>sayHello</strong> <strong>function</strong> with the <strong>arguments</strong>: a literal <strong>String</strong> and <strong>myClosure</strong> constant and finally outputs the string <strong>“Hello Wilson”</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0c3089eda5cc4532e1111842fa366a3/href">https://medium.com/media/a0c3089eda5cc4532e1111842fa366a3/href</a></iframe><p>But there is <strong>lightweight</strong> to create <strong>closures</strong>, instead of creating the <strong>closure</strong> in a <strong>constant</strong>, we could have created it along the <strong>sayHello</strong> calling, like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/180a9d516f18a10beba6578e13e88d1c/href">https://medium.com/media/180a9d516f18a10beba6578e13e88d1c/href</a></iframe><p>In this way we didn’t create a <strong>constant</strong> or <strong>variable</strong> for the <strong>closure</strong> instead we create the <strong>closure</strong> as <strong>inline</strong>.</p><p>There more characteristics about <strong>Closures</strong> that I’d like to cover in other posts, that’s it for now, until next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c6aa80f97c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are Optionals in Swift 3?]]></title>
            <link>https://medium.com/@wilson.balderrama/what-are-optionals-in-swift-3-b669ca4c2f12?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/b669ca4c2f12</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[optionals]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift-3]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Tue, 27 Sep 2016 19:01:21 GMT</pubDate>
            <atom:updated>2016-09-27T19:01:21.314Z</atom:updated>
            <content:encoded><![CDATA[<p>Optionals are only a <strong>type</strong> like any normal <strong>type</strong> else out in <strong>Swift</strong> and they allow us to add a new state/value to any existing or new <strong>type</strong> we may create.</p><p>And that state is a <strong>nil</strong> value, so any type that’s <strong>Optional</strong> could store its intended value or <strong>nil</strong>.</p><p>For instance let’s see this chunk of code:</p><pre>// Code without Optionals<br>var age: Int<br>age = 23<br>print(age) // outputs 23</pre><p>Nothing fancy here but if we apply Optionals to our tiny code it will be like the following:</p><pre>// Code with an Int Optional<br>var age: Int?<br>age = 23<br>print(age) // outputs Optional(23)</pre><p>But instead of printing <strong>23</strong>, it shows <strong>Optional(23) </strong>because we defined our age variable as an <strong>Int? </strong>and not<strong> Int.</strong></p><p>Bear with me let’s change something in the <strong>Code with an Int Optional</strong>:</p><pre>// Code with an Int Optional<br>var age: Int?<br>age = 23<br>age = nil // here<br>print(age) // outputs nil</pre><p>I could set the <strong>age</strong> variable to <strong>nil</strong> even knowing that <strong>age</strong> variable works with <strong>Integer</strong> values but the reason why <strong>age</strong> variable was able to store <strong>nil</strong> is because we set its type as <strong>Int?</strong> remember an <strong>Optional</strong> <strong>type</strong> could store its <strong>value</strong> intended (an <strong>Int</strong> in this case) or a <strong>nil</strong> value.</p><p>On the other side if we try to set nil to the <strong>Int type</strong> that it is not an <strong>Optional</strong>, the <strong>compiler</strong> displays an error to us that <strong>age</strong> variable can’t be assigned with a <strong>nil</strong> value.</p><pre>var age: Int<br>age = 23<br>age = nil // Nil cannot be assigned to type &#39;Int&#39;</pre><p>So going back to the <strong>Code with an Int Optional:</strong></p><pre>// Code with an Int Optional<br>var age: Int?<br>age = 23<br>print(age) // outputs Optional(23)</pre><p>Now when accessing the <strong>value</strong> of the <strong>age variable</strong> in the code that’s above will show that value is wrapped in an Optional, which of course we would want to access the <strong>value 23</strong> and not the <strong>value wrapped</strong> in an <strong>Optional.</strong></p><p>So there a three ways that we can unwrap an Optional in order to access its value and these are:</p><ul><li><strong>Forced unwrapping</strong></li><li><strong>Optional unwrapping</strong></li><li><strong>Automatic unwrapping</strong></li></ul><p>Let’s tackle them one at a time:</p><h4>Forced unwrapping</h4><p>We use this way in order to get the <strong>value</strong> of <strong>age</strong> we put an <strong>exclamation</strong> <strong>mark</strong> at the end of the variable.</p><pre>var age: Int?<br>age = 23<br>print(age!) // outputs 23</pre><p>This option is <strong>not a safe one</strong> because if <strong>age</strong> were a <strong>nil</strong>, it would crash the app, so we need to use a safest way to <strong>unwrap</strong> the <strong>optional</strong> <strong>Int</strong> <strong>value</strong>.</p><h4>Optional unwrapping</h4><p>So this <strong>is the safest</strong> and preferred way to <strong>unwrap</strong> an <strong>optional</strong>, we say if <strong>age</strong> <strong>variable</strong> really contains a <strong>Int</strong> <strong>value</strong> meaning it is not a <strong>nil</strong> <strong>value</strong> then unwrap and assign it to <strong>myAge</strong> variable and that by the way myAge variable will hold an <strong>Int</strong> type and not an <strong>Int?</strong> type thus we can use it as it were a normal variable.</p><p>But if age contains a nil value then the execution flow won’t get to the if body which is great since we wouldn’t want to use <strong>nil.</strong></p><pre>var age: Int?<br>age = 23<br><br>if let myAge = age {<br>  print(myAge) // outputs 23<br>}</pre><h4>Automatic unwrapping</h4><p>It is rare to use this way of unwrapping an optional but it is good to know when you encounter some code using it so it is simply putting the exclamation mark at the end of the type declaration, and then whenever we try to get the value of age, Swift will automatically will unwrap the optional for us giving us the value.</p><pre>var age: Int! // here goes the exclamation mark<br>age = 23<br>print(age) // outputs 23</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b669ca4c2f12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to segue between ViewControllers with different storyboards]]></title>
            <link>https://medium.com/@wilson.balderrama/how-to-segue-between-storyboards-86c582f976f7?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/86c582f976f7</guid>
            <category><![CDATA[view-controller]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[storyboard]]></category>
            <category><![CDATA[segue]]></category>
            <category><![CDATA[swift-3]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Mon, 26 Sep 2016 01:14:29 GMT</pubDate>
            <atom:updated>2016-09-26T01:15:22.296Z</atom:updated>
            <content:encoded><![CDATA[<p>This feature is going to be helpful when you want to divide your views betweens storyboards so that for instance when you work in team, your coworkers may be working on a specific storyboard and you in another one, without having merging problems that’s a big deal!</p><p>Let’s create a new project in <strong>xcode</strong> using the <strong>Single View Application</strong> template:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFeox5PzWAl14O9AmwsFlg.png" /><figcaption>Open Xcode and create a new project</figcaption></figure><p>We are going to need a <strong>Navigation Controller</strong> for our purposes of segue between view controllers so let’s start, go to your <strong>Main.storyboard</strong> file from the navigator side of <strong>xcode</strong> and inside select the <strong>ViewController</strong> from the canvas and then in the top bar menu, select<strong> Editor / Embed In / Navigation Controller</strong> like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCanxJmsV8I82dQy7ULDEw.png" /><figcaption>Embed your ViewController with a Navigation Controller.</figcaption></figure><p>Then go to <strong>Object Library</strong> section and select <strong>Storyboard Reference</strong> control and drag it to the canvas:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRwRJdm3iN4OKSh4Bm8HpQ.png" /></figure><p>Let’s create the <strong>another</strong> <strong>storyboard </strong>going to the top bar menu select <strong>File / New / File</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*re7ErkjmzSm0eyPrxpnVDA.png" /></figure><p>Choose the Storyboard option click next and then give it the name of <strong>Another:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*py8ioqOTFuWjPWMh3bXzWA.png" /></figure><p>Now Select the <strong>Another.storyboard</strong> from the navigation section and create a new <strong>ViewController</strong> in the <strong>canvas</strong> dragging from <strong>Object Library</strong> section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3x28--Qx3OhCbisrnQKJSw.png" /></figure><p>Let’s continue working on <strong>Another.storyboard</strong>, we need to give to the ViewController in the canvas to its <strong>Storyboard Id Identity </strong>a value, we can name it whatever we want, let’s name it with this value: <strong>AnotherViewController</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4uSawJmYaPTyJzP-_-xdnQ.png" /></figure><p>OK so far so good now let’s get back to the <strong>Main.storyboard </strong>file, and select the ViewController in the canvas and drag a Button control from Object library inside the ViewController:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJu5rJqtroe0jAvU9S4UnQ.png" /></figure><p>Then pressing control key and left mouse click hover the button without releasing, then release it inside the <strong>Storyboard Reference</strong> control that we created before in the canvas, so a popup will appear, select the <strong>Show</strong> option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8rxwwcEByYfbQ-5swjd6A.png" /></figure><p>Finally the last thing we need to do in <strong>Main.storyboard </strong>is configure the Storyboard Reference, once we click it, the panel of inspector at the right side will present us some options like <strong>Storyboard</strong> which is set with <strong>Another</strong> value that’s the name of the another storyboard file and <strong>Reference ID </strong>that we set with <strong>AnotherViewController value </strong>which<strong> </strong>represents the Storyboard Id that we gave it to the another ViewController that’s located in <strong>another.storyboard </strong>file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NY0MGfkFtHtpEYpzirSVmA.png" /></figure><p>Now run it and see that the navigation between view controllers are being made even though knowing that both are located in different storyboards files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86c582f976f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make an async call in Swift 3]]></title>
            <link>https://medium.com/@wilson.balderrama/how-to-make-an-async-call-in-swift-3-6b80a789c8b7?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b80a789c8b7</guid>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift-3]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Sun, 25 Sep 2016 01:38:06 GMT</pubDate>
            <atom:updated>2016-09-25T01:38:06.959Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s say we want to get a <strong>Post</strong> from this <a href="https://jsonplaceholder.typicode.com/posts">server url</a> by its id.</p><p>We have a structure declared as <strong>Post</strong> like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e34675889f9ca6ecce44484d29cc8e7/href">https://medium.com/media/7e34675889f9ca6ecce44484d29cc8e7/href</a></iframe><p>So let’s proceed make a network request getting a specific post with an id of 3:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/934271de5c56682d3e95f57efaba96a2/href">https://medium.com/media/934271de5c56682d3e95f57efaba96a2/href</a></iframe><p>The output will be like this:</p><pre>post: Post(id: 2, title: &quot;qui est esse&quot;, userId: 1)</pre><p>Once we know what we want to acomplish let’s see now the implementation of <strong>getPostBy</strong> method:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/abdc3c3bb38ff90ef28f1827aef5be1d/href">https://medium.com/media/abdc3c3bb38ff90ef28f1827aef5be1d/href</a></iframe><p>In the following code, we have an enum <strong>SerializationError</strong> that will help us to know what kind of error the code is throwing when there will be a missing member.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55372420396af0187ca761f9566a15ee/href">https://medium.com/media/55372420396af0187ca761f9566a15ee/href</a></iframe><p>Here it is the constructor <strong>init</strong> method of <strong>Post</strong> structure, the interesting part is that it accepts a dictionary which represent a <strong>Post</strong> from the server.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f09629c3f51b17c5669ec5e472d9255e/href">https://medium.com/media/f09629c3f51b17c5669ec5e472d9255e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b80a789c8b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use DispatchGroup GCD with Swift 3]]></title>
            <link>https://medium.com/@wilson.balderrama/how-to-use-dispatchgroup-gdc-with-swift-3-35455b9c27e7?source=rss-15294c9ab368------2</link>
            <guid isPermaLink="false">https://medium.com/p/35455b9c27e7</guid>
            <category><![CDATA[dispatchgroup]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[gdc]]></category>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[asynchronous]]></category>
            <dc:creator><![CDATA[Wilson Balderrama]]></dc:creator>
            <pubDate>Sat, 24 Sep 2016 18:54:44 GMT</pubDate>
            <atom:updated>2017-06-01T20:34:08.299Z</atom:updated>
            <content:encoded><![CDATA[<p>There were some changes regarding GCD with the new version Swift 3.</p><p>So I will provide a practical example using DispatchGroup.</p><p>Let’s say that we have a method called run which accepts two parameters one is about the number of seconds to be delayed and the another one is a closure that is going be run after the delaying, it would be something like this:</p><pre>let secondsDelay = 3</pre><pre>run(secondsDelay) {</pre><pre> // run this after the seconds delay</pre><pre>}</pre><p>The importante thing with <strong>run</strong> <strong>function</strong> is that calls its closure asynchronously.</p><p>Now let’s say we call <strong>run function </strong>four times and after the four times are complete we want to be notified in order to do something, and the code should be something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e8d3b6442c2e35262385dd02cc986c9/href">https://medium.com/media/7e8d3b6442c2e35262385dd02cc986c9/href</a></iframe><p>First we create <strong>DispatchGroup</strong> called <strong>group</strong>, then before each call to the <strong>run function</strong>, we call <strong>group.enter() </strong>in order to keep track that a call to the <strong>run function</strong> was done.</p><p>And every time that every <strong>run function</strong> completes its delay will call its closure and inside it we call <strong>group.leave() </strong>to tell GDC that the call is complete.</p><p>And only after all the calls to <strong>run function</strong> are done, <strong>group.notify(..) </strong>will be invoked.</p><p>Source of the run function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a8dacb1463e977126301aa511335847/href">https://medium.com/media/0a8dacb1463e977126301aa511335847/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35455b9c27e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>