<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dušan Tadić</title>
    <link>https://www.dusantadic.dev/</link>
    <description>Recent content on Dušan Tadić</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 18 May 2019 15:02:19 +0000</lastBuildDate>
    
	<atom:link href="https://www.dusantadic.dev/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>How not to use enums in Swift</title>
      <link>https://www.dusantadic.dev/post/how-not-to-use-enums/</link>
      <pubDate>Sat, 18 May 2019 15:02:19 +0000</pubDate>
      
      <guid>https://www.dusantadic.dev/post/how-not-to-use-enums/</guid>
      <description>In Swift, enums are powerful. So powerful in fact, that it&amp;rsquo;s easy to abuse them.
Here are some examples of enum abuse, and alternative approaches.
App themes When adding dark theme to your app, instead of a boolean flag, you may add enum like this:
enum Theme { case dark case light }  Sure, using an enum here seems like an obvious choice. But features expand, and you may want to add multiple themes.</description>
    </item>
    
    <item>
      <title>Make UIControl More Swifty</title>
      <link>https://www.dusantadic.dev/post/make-uicontrol-more-swifty/</link>
      <pubDate>Sat, 09 Mar 2019 22:11:43 +0100</pubDate>
      
      <guid>https://www.dusantadic.dev/post/make-uicontrol-more-swifty/</guid>
      <description>In Objective-C, it is possible to set a property either by using dot notation (eg. foo.prop = bar) or by calling a setter (eg. [foo setProp: bar]).
In Swift, there&amp;rsquo;s only one way - the dot notation. If you needed custom behavior in Objective-C for getters or setters, you&amp;rsquo;d implement a setter and/or getter method. In Swift, you&amp;rsquo;d use computed properties like this:
var foo: Bar { get { [...] } set { [.</description>
    </item>
    
  </channel>
</rss>