<?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[Clean Software - Medium]]></title>
        <description><![CDATA[Programming tutorials and more. - Medium]]></description>
        <link>https://medium.com/cleansoftware?source=rss----374766c3de37---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Clean Software - Medium</title>
            <link>https://medium.com/cleansoftware?source=rss----374766c3de37---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:18:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/cleansoftware" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is the CaseIterable Protocol in Swift?]]></title>
            <link>https://medium.com/cleansoftware/what-is-the-caseiterable-protocol-in-swift-e7a1bbebef5a?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/e7a1bbebef5a</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Zafar Ivaev]]></dc:creator>
            <pubDate>Sun, 09 Aug 2020 13:02:57 GMT</pubDate>
            <atom:updated>2020-08-09T13:07:09.541Z</atom:updated>
            <content:encoded><![CDATA[<h4>Iterate over an enum’s cases</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vEDjuDj4W9EqZXcP" /><figcaption>Photo by <a href="https://unsplash.com/@jruscello?utm_source=medium&amp;utm_medium=referral">Jessica Ruscello</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this quick tutorial, we will learn about the CaseIterable protocol in Swift. This handy protocol allows us to iterate over an enum’s cases.</p><h3>Let’s Start</h3><p>Consider the following simple enum:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*MnLGKos9nxpURL-Qm1K80w.png" /></figure><p>By conforming it to the CaseIterable protocol, we can get access to the allCases property, which allows us to iterate over each case:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*v7ClXPYuSed_3WHqve1MBA.png" /></figure><p>Say we want to construct a String that shows all available application statuses.</p><p>We can use .map and .joined functions for that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fQ30Gsb6BGMIe6YTYkeT6Q.png" /></figure><p>The message is printed as expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5WsoxlH3HEiNVsYegEKCQ.png" /></figure><h3>Wrapping Up</h3><p>Want to learn about other handy Swift protocols? Check out these stories below:</p><ul><li><a href="https://medium.com/cleansoftware/what-is-the-expressiblebyintegerliteral-protocol-in-swift-e71ad4a37a96">What is the ExpressibleByIntegerLiteral Protocol in Swift?</a></li><li><a href="https://medium.com/better-programming/when-to-use-the-comparable-protocol-in-swift-b9f137b07413">When to Use the Comparable Protocol in Swift</a></li><li><a href="https://medium.com/better-programming/what-is-the-customstringconvertible-protocol-in-swift-4b7ddbc5785b">What is the CustomStringConvertible Protocol in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-equatable-protocol-in-swift-f3238f6821d6">What is the Equatable Protocol in Swift?</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7a1bbebef5a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/what-is-the-caseiterable-protocol-in-swift-e7a1bbebef5a">What is the CaseIterable Protocol in Swift?</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implement the Command Design Pattern in Swift 5]]></title>
            <link>https://medium.com/cleansoftware/implement-the-command-design-pattern-in-swift-5-a3a07352af09?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/a3a07352af09</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Zafar Ivaev]]></dc:creator>
            <pubDate>Thu, 06 Aug 2020 17:07:57 GMT</pubDate>
            <atom:updated>2020-08-06T17:07:20.242Z</atom:updated>
            <content:encoded><![CDATA[<h4>Encapsulate and execute actions over time</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EzFHsJytYh0uByUn" /><figcaption>Photo by <a href="https://unsplash.com/@nordwood?utm_source=medium&amp;utm_medium=referral">NordWood Themes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, we will learn about the Command design pattern and implement it in an Xcode Playground.</p><p>In short, the Command is a behavioral design pattern that helps us <em>encapsulate actions</em> (commands) and execute them at a <em>later point</em> in time.</p><p>It involves the following components:</p><ul><li><em>Invoker</em> — an object that executes its commands</li><li><em>Command</em> — an action that needs to be performed</li><li><em>Receiver</em> — an object that is being acted upon.</li></ul><h3>Let’s Start</h3><p>Consider an example of a moderator who reviews an app. The moderation process may have different states: inReview, approved, and rejected. We want to set specific commands for the moderator and execute them one-by-one with some delay. So let’s start creating the required components.</p><h3>Receiver</h3><p>Our receiver is an App class that has a dependency on the ModerationState. Its initial state is submittedForReview:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ded333e40e66d7804d4a7336fb2d1f0/href">https://medium.com/media/1ded333e40e66d7804d4a7336fb2d1f0/href</a></iframe><p>Next, let’s create a <em>Command</em>.</p><h3>Command</h3><p>We start with a base class that each specific command with inherit from:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e849e44e06a488d9ab3c6beed3dad67/href">https://medium.com/media/2e849e44e06a488d9ab3c6beed3dad67/href</a></iframe><p>The command depends on the single App object that we will mutate accordingly in subclasses. Now let’s create these subclasses:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d812422ef7e31feb3d82036624039c3/href">https://medium.com/media/8d812422ef7e31feb3d82036624039c3/href</a></iframe><p>As we can see, each command changes the moderationState property of the App object inside the execute() method.</p><p>With commands done, now we need to create an <em>Invoker</em>.</p><h3>Invoker</h3><p>We create the Moderator class that will act an invoker of the aforementioned commands. It has a [ModerationCommand] array and an App object. Once its commands property is set, it starts reviewing the App by executing each command with some delay. Using a DispatchSemaphore we allow only one command to be executed at a time:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3a98bc71966c71ef9762184232d07a2/href">https://medium.com/media/d3a98bc71966c71ef9762184232d07a2/href</a></iframe><p>Now we can test what we have created. Let’s initialize the Moderator and provide it with four moderation commands as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/350759c3ba2ef3b046f0d299647965ee/href">https://medium.com/media/350759c3ba2ef3b046f0d299647965ee/href</a></iframe><p>As expected, the following messages are printed in the console, each after a specific delay:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*piaqk_GrMh0ZhRc5M5YBmQ.png" /></figure><p>We have implemented the Command design pattern.</p><h3>Resources</h3><p>The source code of the playground is available in a <a href="https://gist.github.com/zafarivaev/3b59057dee13e0eb14bdd0bf764b9b2c">Gist</a>.</p><h3>Wrapping Up</h3><p>Want to learn more about design patterns in Swift? Feel free to check out my other relevant pieces:</p><ul><li><a href="https://medium.com/better-programming/leverage-the-coordinator-design-pattern-in-swift-5-cd5bb9e78e12">Leverage the Coordinator Design Pattern in Swift 5</a></li><li><a href="https://medium.com/better-programming/implement-the-facade-design-pattern-in-swift-dcc4325754ff">Implement the Facade Design Pattern in Swift 5</a></li><li><a href="https://medium.com/better-programming/implement-the-adapter-design-pattern-in-swift-165ac22bc868">Implement the Adapter Design Pattern in Swift 5</a></li><li><a href="https://medium.com/better-programming/implement-the-strategy-design-pattern-in-swift-5d9c3f221277">Implement the Strategy Design Pattern in Swift 5</a></li><li><a href="https://medium.com/better-programming/implement-the-builder-design-pattern-in-swift-5-ff5bc6f2fc3d">Implement the Builder Design Pattern in Swift 5</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3a07352af09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/implement-the-command-design-pattern-in-swift-5-a3a07352af09">Implement the Command Design Pattern in Swift 5</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the Equatable Protocol in Swift?]]></title>
            <link>https://medium.com/cleansoftware/what-is-the-equatable-protocol-in-swift-3cced3f28219?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/3cced3f28219</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Abboskhon Shukurullaev]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 06:45:38 GMT</pubDate>
            <atom:updated>2020-07-19T09:25:31.841Z</atom:updated>
            <content:encoded><![CDATA[<h4>Inspect your custom objects for equality</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YiMkNsYou3Ht5_Xu" /><figcaption>Photo by <a href="https://unsplash.com/@ben_wong_31?utm_source=medium&amp;utm_medium=referral">Benjamin Wong</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Today we will learn about a protocol that provides a clear way to find out if your custom objects are equal.</p><p>Without further ado, let’s explore Equatable protocol<em> </em>in practice.</p><h3>Let’s Start</h3><p>Say we have simple struct called StudentsBook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b34df4bb0b80a58abdd21f8575975de0/href">https://medium.com/media/b34df4bb0b80a58abdd21f8575975de0/href</a></iframe><p>But how can we make sure it’s the right student? In order to compare instances for equality we need to:</p><ul><li>Adopt Equatable protocol</li><li>Provide an implementation for the == operator. Simply add a static == func that takes lhs (left-hand side) and rhs (right-hand side) parameters and returns a Bool that decides whether the two sides are equal or not.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d57314087b30a0b4888a8a4e2b4a425/href">https://medium.com/media/1d57314087b30a0b4888a8a4e2b4a425/href</a></iframe><p>By doing this, we’ve compared all instances and get a pure result.</p><p>However, in certain cases, there are requirements of a protocol that can be autogenerated for you. You only specify the name of protocol and don’t write == method on your own. The Swift compiler will autogenerate the implementation just by looking at data types.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0fbb6ca4839c9967541c46e52147bc3b/href">https://medium.com/media/0fbb6ca4839c9967541c46e52147bc3b/href</a></iframe><h3>Wrapping up</h3><p>This is all you should know about Equatable protocol. I hope it was interesting!</p><p>Interested in other relative protocols? Feel free to visit my other relevant articles:</p><ul><li><a href="https://levelup.gitconnected.com/creating-your-own-protocols-in-swift-e266707892b7">Creating your own Protocols in Swift</a></li><li><a href="https://levelup.gitconnected.com/what-is-codable-protocol-in-swift-50103c2d9d02">What is Codable Protocol in Swift?</a></li><li><a href="https://levelup.gitconnected.com/what-is-comparable-protocol-in-swift-8cb854e30cf7">What is Comparable Protocol in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-customstringconvertible-protocol-in-swift-cbb766afac4d">What Is the CustomStringConvertible Protocol in Swift?</a></li></ul><p>If you have any criticism, question, or suggestion, feel free to post them in the comment section below!</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cced3f28219" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/what-is-the-equatable-protocol-in-swift-3cced3f28219">What is the Equatable Protocol in Swift?</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do This After Installing Kali Linux]]></title>
            <link>https://medium.com/cleansoftware/do-this-after-installing-kali-linux-4569146d43ee?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/4569146d43ee</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Diyorbek Juraev]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 19:44:52 GMT</pubDate>
            <atom:updated>2020-07-01T19:53:04.352Z</atom:updated>
            <content:encoded><![CDATA[<h4>Top 5 things to do to get started</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D-aKJwZQbvGcL10D" /><figcaption>Photo by <a href="https://unsplash.com/@lazycreekimages?utm_source=medium&amp;utm_medium=referral">Michael Dziedzic</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When you first installed Kali Linux on your Virtual Box or as a main OS for your Laptop you should be wondering what to do after?</p><p>This article is going to help you with that!</p><h4>Let’s begin.</h4><ol><li><em>Install Git.</em></li></ol><p>Git is the open-source software version control application. This tool will help you to collaboratively share and edit the code. But git commonly used for cloning and copying code repositories found on Github. This tool is must have for PenTester or an Ethical Hacker looking to expand their toolset beyond what is available in Kali Linux.</p><p>This tool can be installed using code below.</p><p>In terminal type:</p><blockquote>sudo apt-get install git</blockquote><p>2. <em>Install Terminator.</em></p><p>Terminator is the GNU terminal emulator, which provides several features that your default terminal app does not support. It provides the ability to create multiple terminal windows in one window and faster your work flow.</p><p>Other than that, it allows you to change other properties such as fonts, fonts color and many more. It will be useful for any Hacker or prospective PenTester.</p><p>This tool can be installed using code below.</p><p>In terminal type:</p><blockquote>sudo apt-get install terminator</blockquote><p>If terminator is not available in your repository you can add new repositories as I mentioned in my <a href="https://medium.com/cleansoftware/how-to-update-kali-linux-repositories-91b566d03b11">pervious post</a>.</p><p>Just add these two repositories:</p><blockquote>deb http://http.kali.org/kali kali-rolling main contrib non-free</blockquote><blockquote>deb-src http://http.kali.org/kali kali-rolling main contrib non-free</blockquote><blockquote>then do,</blockquote><blockquote>sudo apt-get update &amp;&amp; sudo apt-get -y upgrade</blockquote><blockquote>sudo apt-get install terminator</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vetV2qtfIr5I_FTAkWCCbw.png" /></figure><p>3. <em>Install Most Popular Hacking Tools</em>.</p><p>Many Hackers and PenTesters do not use all the tools which are in Kali Linux preinstalled. This means they only install tools which they prefer and know well how to use them or which they want to master. Below I will add some popular hacking tools.</p><blockquote>Aircrack-ng: Wireless WEP/WPA cracking utilities.<br> BeEF: Browser exploitation framework via web applications.<br> Burp Suite: Graphical application designed for web application security.<br> Hydra: Login password brute-forcing utility.<br> Nikto: Web server security scanner.<br> Maltego: Open-source forensics and intelligence gathering.<br> Nmap: Port scanner and network mapper.<br> Wireshark: Graphical application for network traffic analysis.</blockquote><p>You can install them one by one using apt-get install</p><p>Or use this command below to install them all in one.</p><p>In terminal type:</p><blockquote>apt-get install maltego metasploit-framework burpsuite wireshark aircrack-ng hydra nmap beef-xss nikto</blockquote><p>4.<em> Install Geany.</em></p><p>Geany is a free, open-source, feature-rich, and highly customizable code editor. It can be used with various programming languages such as Python, HTML5, PHP, JAVA, JAVAscript, C#, C++, Ruby, Swift, Bash and many more.</p><p>This tool can be installed using code below.</p><p>In terminal type:</p><blockquote>apt-get install geany</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swGECMeF1yawYUE7wPew3Q.png" /></figure><p>5. <em>Install Tor.</em></p><p>Tor is the anonymity software which every hacker and PenTester should learn how use it. Tor comes preinstalled in Kali Linux but it is not reliably maintained or updated, so it is secure to acquire it directly from the source (torproject.org).</p><p>First we are going to do is to add Tor repositories to your repository list.</p><p>Add them as I showed in my <a href="https://medium.com/cleansoftware/how-to-update-kali-linux-repositories-91b566d03b11">pervious post</a>.</p><blockquote>deb https://deb.torproject.org/torproject.org stretch main<br>deb-src https://deb.torproject.org/torproject.org stretch main</blockquote><p>Then, download the Tor Project package signing key and import it into your APT keyring.</p><blockquote>wget -O- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo apt-key add -</blockquote><p>You’ll see the “OK” output when the signing key has been added to your keyring. Next, update APT using the below apt-get command.</p><blockquote>sudo apt-get update</blockquote><p>Then, install Tor typing command below.</p><p>In terminal type:</p><blockquote>apt-get install tor deb.torproject.org-keyring</blockquote><p>After Installing all of these you should be ready to go with Kali Linux. Now depending on your interests, skill sets and level of experience, you will start personalizing your system.</p><p>Check out my previous posts on Linux and Kali Linux:</p><ul><li><a href="https://medium.com/cleansoftware/how-to-update-kali-linux-repositories-91b566d03b11">How To Update Kali Linux Repositories.</a></li><li><a href="https://medium.com/cleansoftware/how-to-customize-any-linux-terminal-fef838b34a6e">How to Customize Any Linux Terminal.</a></li><li><a href="https://medium.com/datadriveninvestor/deauthentication-using-the-aircrack-suite-in-kalilinux-cdd13568c2a1">Deauthentication using the Aircrack suite in Kali Linux.</a></li><li><a href="https://medium.com/cleansoftware/how-to-install-kali-linux-2020-1-on-virtualbox-954957b784ab">How to install Kali Linux 2020.1 on VirtualBox.</a></li><li><a href="https://medium.com/datadriveninvestor/how-hackers-and-cybercriminals-make-money-on-stolen-credential-information-ccbad3c433f0">How Hackers and Cybercriminals make money.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4569146d43ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/do-this-after-installing-kali-linux-4569146d43ee">Do This After Installing Kali Linux</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Customize Any Linux Terminal]]></title>
            <link>https://medium.com/cleansoftware/how-to-customize-any-linux-terminal-fef838b34a6e?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/fef838b34a6e</guid>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Diyorbek Juraev]]></dc:creator>
            <pubDate>Wed, 01 Jul 2020 00:23:14 GMT</pubDate>
            <atom:updated>2020-07-30T07:20:15.232Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Customize Kali Linux Terminal</h3><h4>Installing Graphical Tools in linux terminal</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FNuuMwDdv77y7ZPI" /><figcaption>Photo by <a href="https://unsplash.com/@hidd3n?utm_source=medium&amp;utm_medium=referral">Kevin Horvat</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Today, In this article I am going to show some cool looking graphical tools and how to install them.</p><h3>Let’s Begin</h3><p>There are a lot of graphical tools that you can use to customize your Linux terminal. <br>To stylize the terminal a bit more I would like to hide the menu bar and increase the terminal’s transparency to 14%. But this is up to your decision. To do that you can find both of these settings inside the preferences window with right-click, then go to the Appearance section. <br>There, you will need to uncheck the Show the menu bar box and change the transparency value to your own wished one. Furthermore, you can the whole window or the specific area, I usually like to change an only top area of the terminal.</p><p>Let’s start from the first tool — htop.</p><p>htop — This is an interactive process viewer and process manager tool, which will help you track all running background jobs and check the status of your CPU and GPU.</p><p>In terminal type:</p><blockquote><em>sudo apt install -y htop</em></blockquote><p>And it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSQKuMtcbbwo7hblJAWEpA.png" /></figure><p>Second tool is gotop.</p><p>gotop<em> i</em>s the terminal-based graphical activity monitor.</p><p>To install it we will need to use third party repository,</p><p>In terminal type:</p><blockquote><em>sudo apt install -y golang</em></blockquote><blockquote><em>go get github.com/cjbassi/gotop</em></blockquote><blockquote><em>go run github.com/cjbassi/gotop</em></blockquote><p>And it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvQUk4attEyOnBc2fhsfcg.png" /></figure><p>Third tool is neofetch<em>.</em></p><p>neofetch is the command line system informational tool.</p><p>In terminal type:</p><blockquote><em>sudo apt install -y neofetch</em></blockquote><p>And it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*6B0cUb85Ekr-zZhiAXy5sg.png" /></figure><p>Last but not least — lolcat.</p><p>lolcat is the tool to give unique look to your terminal. Adds a stunning rainbow effect to its output.</p><p>In terminal type:</p><blockquote><em>sudo apt install -y lolcat</em></blockquote><p>And it will look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*5p-ob7VWkAQUVNiIvyJoDQ.png" /></figure><p>That is all, so now you can use these graphical tools to make your Linux experience personalized.</p><p>Check out my previous posts on Linux and Kali Linux:</p><ul><li><a href="https://medium.com/cleansoftware/how-to-update-kali-linux-repositories-91b566d03b11">How To Update Kali Linux Repositories.</a></li><li><a href="https://medium.com/datadriveninvestor/deauthentication-using-the-aircrack-suite-in-kalilinux-cdd13568c2a1">Deauthentication using the Aircrack suite in Kali Linux.</a></li><li><a href="https://medium.com/cleansoftware/how-to-install-kali-linux-2020-1-on-virtualbox-954957b784ab">How to install Kali Linux 2020.1 on VirtualBox.</a></li><li><a href="https://medium.com/datadriveninvestor/how-hackers-and-cybercriminals-make-money-on-stolen-credential-information-ccbad3c433f0">How Hackers and Cybercriminals make money.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fef838b34a6e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/how-to-customize-any-linux-terminal-fef838b34a6e">How to Customize Any Linux Terminal</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implement Swipe Functionality in Swift 5]]></title>
            <link>https://medium.com/cleansoftware/implement-swipe-functionality-in-swift-5-a2185b31a78d?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/a2185b31a78d</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Zafar Ivaev]]></dc:creator>
            <pubDate>Sun, 14 Jun 2020 16:41:41 GMT</pubDate>
            <atom:updated>2020-08-07T20:04:19.894Z</atom:updated>
            <content:encoded><![CDATA[<h4>Supporting both left and right directions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HqzZPQytyDhn2W9H" /><figcaption>Photo by <a href="https://unsplash.com/@kartikbhattacharjee?utm_source=medium&amp;utm_medium=referral">Kartik Bhattacharjee</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article we will learn how to implement a swipe functionality in a simple Xcode Playground project.</p><p>The source code of the project is available at the bottom of the article.</p><h3>Let’s Start</h3><p>First, let’s create a SwipeableViewController:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4cb9ed596510b02407daa8102cbc4a4/href">https://medium.com/media/c4cb9ed596510b02407daa8102cbc4a4/href</a></iframe><p>Now we need to add two UISwipeGestureRecognizers, one for the left and another for the right direction. We also need to add them to the view controller’s view:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/efaa715e7944002b89e49cd45bb8b6a6/href">https://medium.com/media/efaa715e7944002b89e49cd45bb8b6a6/href</a></iframe><p>Now the last step: creating selectors and linking each with an according gesture recognizer (note that we use lazy variables as we want to use self in the addTarget method):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a43678fbb703dba159ba8218add3b177/href">https://medium.com/media/a43678fbb703dba159ba8218add3b177/href</a></iframe><p>Now if we run the Playground and perform swipes in different directions we will see the output in the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*XLGb19i-arXNFeJ1aMMF-Q.png" /></figure><p>If you are wondering where could we apply this implementation, then consider the screen where you have tabs on the top and you want to change the currently displayed content by swiping left and right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*YoX5NdCLwTlBktNvDWh-Ig.gif" /></figure><h3>Resources</h3><p>The source code is available in a <a href="https://gist.github.com/zafarivaev/433daff1165479e8c465f589078d796e">Gist</a>.</p><h3>Wrapping Up</h3><p>Interested in more lesser-known features of Swift? Feel free to check out my other relevant pieces:</p><ul><li><a href="https://medium.com/better-programming/what-is-the-operator-in-swift-7f6bc7623023">What is the ~= Operator in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-equatable-protocol-in-swift-f3238f6821d6">What is the Equatable Protocol in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-vdsp-framework-in-swift-fe2539693e9a">What Is the vDSP Framework in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-customstringconvertible-protocol-in-swift-4b7ddbc5785b">What is the CustomStringConvertible Protocol in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-difference-between-class-and-static-in-swift-3493848ed831">What Is the Difference Between Class and Static in Swift?</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2185b31a78d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/implement-swipe-functionality-in-swift-5-a2185b31a78d">Implement Swipe Functionality in Swift 5</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift: How to Create a Timer in Combine]]></title>
            <link>https://medium.com/cleansoftware/swift-how-to-create-a-timer-in-combine-43192dab4d3?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/43192dab4d3</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Zafar Ivaev]]></dc:creator>
            <pubDate>Sun, 14 Jun 2020 11:50:43 GMT</pubDate>
            <atom:updated>2020-06-14T11:50:43.071Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using a built-in publisher</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3vU37MgWUiR-W8wS" /><figcaption>Photo by <a href="https://unsplash.com/@tfrants?utm_source=medium&amp;utm_medium=referral">Tyler Franta</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this tutorial we will learn how to create a simple repeating timer using a built-in Combine’s publisher.</p><p>We will do so by quickly implementing it in an Xcode Playground.</p><p>The full source code is available at the bottom of the article.</p><h3>Let’s Start</h3><p>First we need to create a Set of AnyCancellable where we will store our timer subscription:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/046251b52afcceb23affe4728f982666/href">https://medium.com/media/046251b52afcceb23affe4728f982666/href</a></iframe><p>Now let’s specify the starting Date we will use for our timer:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6bc2e6558acc455f3664ad76baf77ab6/href">https://medium.com/media/6bc2e6558acc455f3664ad76baf77ab6/href</a></iframe><p>We can create a timer by using the .publish method on the Foundation’s Timer class (we specify the value of 1.0 as a parameter, because we want to print a value every second):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2a398c21df007da15225622582cba89/href">https://medium.com/media/e2a398c21df007da15225622582cba89/href</a></iframe><p>The .autoconnect() allows us to start a timer once we have a subscriber. If we don’t use that operator, then we will need to call .connect() manually.</p><p>Let’s now obtain the TimeInterval and transform it into an Int using the .map operator:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bd642a0eff85bef2adf71923159cd77/href">https://medium.com/media/8bd642a0eff85bef2adf71923159cd77/href</a></iframe><p>All that is left is to subscribe for the publisher and store the resulting subscription in our previously defined Set of AnyCancellables:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dd339f1b39e418f2e88ed99acb26efd/href">https://medium.com/media/6dd339f1b39e418f2e88ed99acb26efd/href</a></iframe><p>As a result, we have the seconds printed out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSyeapEazJzotNJuRFHstg.png" /></figure><h3>Resources</h3><p>The source code is available in a <a href="https://gist.github.com/zafarivaev/e4b8b473b9b971c656a25af580016670">Gist</a>.</p><h3>Wrapping Up</h3><p>Interested in more Swift articles? Feel free to visit my other relevant pieces:</p><ul><li><a href="https://medium.com/better-programming/how-to-create-a-timer-in-rxswift-578bf8712678">How to Create a Timer in RxSwift</a></li><li><a href="https://medium.com/better-programming/mvvm-in-swift-infinite-scrolling-and-image-loading-d47780b06e23">Implement a Reactive MVVM Architecture in Swift 5</a></li><li><a href="https://medium.com/better-programming/what-is-the-value-binding-pattern-in-swift-a644be3e0597">What Is the Value-Binding Pattern in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-vdsp-framework-in-swift-fe2539693e9a">What Is the vDSP Framework in Swift?</a></li><li><a href="https://medium.com/better-programming/replace-delegation-with-rxswift-32ad18d75140">Replace Delegation With RxSwift</a></li><li><a href="https://medium.com/better-programming/what-is-the-difference-between-class-and-static-in-swift-3493848ed831">What Is the Difference Between Class and Static in Swift?</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43192dab4d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/swift-how-to-create-a-timer-in-combine-43192dab4d3">Swift: How to Create a Timer in Combine</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the ObservableObject Protocol in Swift’s Combine?]]></title>
            <link>https://medium.com/cleansoftware/what-is-the-observableobject-protocol-in-swifts-combine-b6ad3102ccd4?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/b6ad3102ccd4</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Zafar Ivaev]]></dc:creator>
            <pubDate>Sun, 14 Jun 2020 11:08:24 GMT</pubDate>
            <atom:updated>2020-06-14T11:09:32.565Z</atom:updated>
            <content:encoded><![CDATA[<h4>Allow your object to self-monitor its properties</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eGTajFiaMoCNuL-S" /><figcaption>Photo by <a href="https://unsplash.com/@wesson?utm_source=medium&amp;utm_medium=referral">Wesson Wang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Conforming to the ObservableObject protocol provides a handy way to monitor when one of its @Published properties change. However, we can’t know which exact property has changed. It is created to help you when using SwiftUI in your projects.</p><p>Without a further ado, let’s explore the ObservableObject protocol in practice.</p><h3>Let’s Start</h3><p>Say we have a simple class called ObjectToBeObserved:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae677926fa597f410b5352140c67c4a0/href">https://medium.com/media/ae677926fa597f410b5352140c67c4a0/href</a></iframe><p>What if we want to be notified when its value property is changed? We can conform to the ObservableObject and mark the value property with a Published property wrapper:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00e31219b0cfabb3836128cb2256a432/href">https://medium.com/media/00e31219b0cfabb3836128cb2256a432/href</a></iframe><p>Behind the scenes, the objectWillChange publisher is created, which we will use now to observe for changes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/489c64c20cc642bc57489e36e6cd91d3/href">https://medium.com/media/489c64c20cc642bc57489e36e6cd91d3/href</a></iframe><p>We can now test the implementation by assigning a new value to the value property:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7956f563c2c87790e77cf8e700bcce36/href">https://medium.com/media/7956f563c2c87790e77cf8e700bcce36/href</a></iframe><p>As a result, we see the “Object has changed” printed two time in the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkqHuj1olsqX8FCu2Dneaw.png" /></figure><p>Now you may think, why didn’t we simply use the Published property wrapper and subscribe to it? As I said in the beginning the ObservableObject protocol is designed to work with SwiftUI.</p><p>Let’s explore how we use it with SwiftUI now. Here is our original ObjectToBeObserved:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c6f35019dc5ff06ec2a2bb003c4382c/href">https://medium.com/media/9c6f35019dc5ff06ec2a2bb003c4382c/href</a></iframe><p>Now let’s create a View:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d8ab27b30e220167676e4093edb4e3b/href">https://medium.com/media/9d8ab27b30e220167676e4093edb4e3b/href</a></iframe><p>Now the Text is automatically updated when the value property of the ObjectToBeObserved changes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObjZIaNY7DUX0JwOYO00kg.png" /></figure><h3>Wrapping Up</h3><p>Interested in other reactive techniques? Feel free to visit my other relevant articles:</p><ul><li><a href="https://medium.com/better-programming/replace-delegation-with-rxswift-32ad18d75140">Replace Delegation With RxSwift</a></li><li><a href="https://medium.com/better-programming/mvvm-in-swift-infinite-scrolling-and-image-loading-d47780b06e23">Implement a Reactive MVVM Architecture in Swift 5</a></li><li><a href="https://medium.com/better-programming/how-to-create-a-timer-in-rxswift-578bf8712678">How to Create a Timer in RxSwift</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6ad3102ccd4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/what-is-the-observableobject-protocol-in-swifts-combine-b6ad3102ccd4">What is the ObservableObject Protocol in Swift’s Combine?</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Guide to Using Optionals in Swift 5]]></title>
            <link>https://medium.com/cleansoftware/beginners-guide-to-using-optionals-in-swift-5-f40caae4edb7?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/f40caae4edb7</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Abboskhon Shukurullaev]]></dc:creator>
            <pubDate>Fri, 12 Jun 2020 18:32:47 GMT</pubDate>
            <atom:updated>2021-04-17T07:38:01.651Z</atom:updated>
            <content:encoded><![CDATA[<h4>With clear examples</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Saly2PcP2maQ8GbH" /><figcaption>Photo by <a href="https://unsplash.com/@ilyapavlov?utm_source=medium&amp;utm_medium=referral">Ilya Pavlov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Intro</h3><p>Optionals keep our data types nil, with the promise that they will be filled later. It is vitally important, when we need to parse data from JSON, but, we don’t have it right now.</p><p>When you access a force unwrapped optional that has a nil value, Xcode throws a runtime error telling that some nil value has been found while trying to read the property.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qPU8eCvHKYfLxDjZFSbKA.png" /></figure><p>Hence, to avoid this unpleasant situation and we need to resort to <strong>optional binding</strong>. Optional bindings checks the existence of data types first, and then allows to start an operation. If data types remain nil for some reason, it simply ignores the step, avoiding the runtime error.</p><h3>Let’s start</h3><p><em>Optional binding</em> is the process of attempting to assign an optional value to a constant in a conditional statement to see if the optional contains an underlying value. Optional binding unwraps the optional and, if it contains a value assign value to a constant as a non-optional type, making it safe to work with. This approach get rid of the need to continue working with the ambiguity of whether or not you are working with a value or with <em>nil.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/216992f0bafe06543c56557c8cbebb27/href">https://medium.com/media/216992f0bafe06543c56557c8cbebb27/href</a></iframe><p>Example of using the <em>if-let</em> optional binding:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a2ecef5f831765fe0a50d2786ec9af1/href">https://medium.com/media/4a2ecef5f831765fe0a50d2786ec9af1/href</a></iframe><p>So now, if there’re no carrots, the console will have “There is no carrots” printed out.</p><h4>Optional chaining</h4><p>It is possible that optional value has its own optional properties, which may be illustrated as a box within a box. These are called <em>nested optionals.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0bc2ffbc9d9e3a98a4d13261dc9b9c4/href">https://medium.com/media/b0bc2ffbc9d9e3a98a4d13261dc9b9c4/href</a></iframe><h4>Guard</h4><p>A <em>guard</em> statement declares a condition that must be true in order for the code after the guard statement to be executed. Using a guard statement for requirements improves the readability of your code, as opposed to using an if statement for the same check.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b91cebe82183400788742d9a1ddf6e86/href">https://medium.com/media/b91cebe82183400788742d9a1ddf6e86/href</a></iframe><p>Now, let’s illustrate the difference of how if and guard work:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3157e62df3bc3431e1fd7e6627c614ac/href">https://medium.com/media/3157e62df3bc3431e1fd7e6627c614ac/href</a></iframe><p>We can render the same code using more readable<em> guard</em> statement:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/915c044ebaf9668249d006a82356aa0a/href">https://medium.com/media/915c044ebaf9668249d006a82356aa0a/href</a></iframe><h3>Difference between “if let” and “guard let”.</h3><h4>Guard with Optionals</h4><p>Earlier in this article you’ve learned about optionals and how to perform work with optional binding <em>if-let</em>. When you unwrap optional using if-let syntax to bind it to a constant, the constant is valid within the braces.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c4a2e750d7b0b6a17935234c6851721/href">https://medium.com/media/6c4a2e750d7b0b6a17935234c6851721/href</a></iframe><p>Instead, you can use optional binding <em>guard let </em>and you will be able to interact with your code <em>outside</em> of the braces<em>. </em>Just as you compared guard with if statements, guard let is an <em>opposite</em> of if let as well.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51a4f5232319ad7da84d38b7b27a8415/href">https://medium.com/media/51a4f5232319ad7da84d38b7b27a8415/href</a></iframe><p>The same situation with if let and guard let happens inside functions. Guard let makes all constants available throughout the rest of the function, while if let<em> </em>allows only within the control flow braces<em>.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/caf5dfc10b0ab2412273e13c1f49c135/href">https://medium.com/media/caf5dfc10b0ab2412273e13c1f49c135/href</a></iframe><h3>Closing thoughts</h3><p>On this note we came to the end of optionals. I hope you have deep knowledge of optionals and can easily fly between types of optional bindings. If there are still some questions that bother you, feel free to leave a comment.</p><p>Interested in other relative topics? Feel free to visit my other relevant articles:</p><ul><li><a href="https://levelup.gitconnected.com/demystifying-struct-class-and-enum-in-swift-5-43dde089e96a">Demystifying Struct, Class, and Enum in Swift 5</a></li><li><a href="https://medium.com/p/c5b7ad2dd0ab/edit">Clearing Up the Confusing Closures Concept in Swift</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f40caae4edb7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/beginners-guide-to-using-optionals-in-swift-5-f40caae4edb7">Your Guide to Using Optionals in Swift 5</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use NumberFormatter in Swift?]]></title>
            <link>https://medium.com/cleansoftware/how-to-use-numberformatter-in-swift-2a448d520266?source=rss----374766c3de37---4</link>
            <guid isPermaLink="false">https://medium.com/p/2a448d520266</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Zafar Ivaev]]></dc:creator>
            <pubDate>Fri, 12 Jun 2020 10:32:55 GMT</pubDate>
            <atom:updated>2020-06-13T18:42:56.734Z</atom:updated>
            <content:encoded><![CDATA[<h4>Represent numerical values the way you want</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w3vX-8aor1AQmd7n" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>You don’t need to tell me how many times you have written something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25dec7c67600451a27d553c9045b671f/href">https://medium.com/media/25dec7c67600451a27d553c9045b671f/href</a></iframe><p>Using string interpolation is fine, but how do we make the previous operation more succinct?</p><p>Welcome the NumberFormatter class</p><h3>Using NumberFormatter</h3><p>Let’s instantiate a NumberFormatter and set its numberStyle property:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f41c83b1527091504540ae635a2f140d/href">https://medium.com/media/f41c83b1527091504540ae635a2f140d/href</a></iframe><p>As we can see, we specified that we want a currency representation of our values.</p><p>Let’s quickly test some values:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9b7e4166919fa943149a90435d5c15e/href">https://medium.com/media/e9b7e4166919fa943149a90435d5c15e/href</a></iframe><p>We see the following printed in the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Zm4otOSkWjJOm62-l5W_w.png" /></figure><p>We can easily change the currency symbol to euro:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e361734da7b1e5f18e79b1978f1e4fa2/href">https://medium.com/media/e361734da7b1e5f18e79b1978f1e4fa2/href</a></iframe><p>As a result we have euro values printed out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lk0n5bi4odpMBObsu8J-pQ.png" /></figure><p>What is great about the NumberFormatter class is that it provides many options for setting our target representation type:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WYi7pa3U7QeG2Yk6hvQYw.png" /></figure><p>Let’s change the numberStyle to .spellOut:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8050ddf95ae099f2700ccee288d2df70/href">https://medium.com/media/8050ddf95ae099f2700ccee288d2df70/href</a></iframe><p>So we have our numbers spelled out in the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTLO1B5s3qF7eclLB0RBIA.png" /></figure><h3>Wrapping Up</h3><p>To learn more about NumberFormatter, visit the official Apple documentation:</p><p><a href="https://developer.apple.com/documentation/foundation/numberformatter">NumberFormatter | Apple Developer Documentation</a></p><p>Want to learn more about Swift? Feel free to check out my other articles:</p><ul><li><a href="https://medium.com/better-programming/what-is-the-difference-between-class-and-static-in-swift-3493848ed831">What Is the Difference Between Class and Static in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-the-operator-in-swift-7f6bc7623023">What is the ~= Operator in Swift?</a></li><li><a href="https://medium.com/better-programming/what-is-a-labeled-statement-in-swift-2d245ac7b4e7">What Is a Labeled Statement in Swift?</a></li><li><a href="https://levelup.gitconnected.com/implement-the-key-value-observation-in-swift-5-e6f24638a26f">Implement the Key-Value Observation in Swift 5</a></li><li><a href="https://medium.com/cleansoftware/what-is-the-expressiblebyintegerliteral-protocol-in-swift-e71ad4a37a96">What is the ExpressibleByIntegerLiteral Protocol in Swift?</a></li></ul><p>Thanks for reading!</p><p><a href="https://chipper-innovator-5449.ck.page/7fae0382e7">Want to learn more?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a448d520266" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cleansoftware/how-to-use-numberformatter-in-swift-2a448d520266">How to Use NumberFormatter in Swift?</a> was originally published in <a href="https://medium.com/cleansoftware">Clean Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>