<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anton Dikson</title>
    <description>The latest articles on DEV Community by Anton Dikson (@adiks).</description>
    <link>https://dev.to/adiks</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F597900%2Fa2a2ed97-15ce-4a9a-ace5-7f03ea25e151.jpeg</url>
      <title>DEV Community: Anton Dikson</title>
      <link>https://dev.to/adiks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adiks"/>
    <language>en</language>
    <item>
      <title>Random cheat sheet for IOS-Developer</title>
      <dc:creator>Anton Dikson</dc:creator>
      <pubDate>Sat, 15 May 2021 17:15:53 +0000</pubDate>
      <link>https://dev.to/adiks/random-cheat-sheet-for-ios-developer-389l</link>
      <guid>https://dev.to/adiks/random-cheat-sheet-for-ios-developer-389l</guid>
      <description>&lt;h3&gt;
  
  
  Access Control
&lt;/h3&gt;

&lt;p&gt;Access modifiers serve not only to encapsulate our code. But they can also speed up the runtime of our application. These modifiers are &lt;code&gt;private&lt;/code&gt; and &lt;code&gt;final&lt;/code&gt;. The &lt;code&gt;final&lt;/code&gt; I use for all classes.&lt;br&gt;
&lt;a href="https://developer.apple.com/swift/blog/?id=27"&gt;More information here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Structure
&lt;/h3&gt;

&lt;p&gt;Try to use structures instead of classes. Because structures are more secure (&lt;a href="https://developer.apple.com/swift/blog/?id=10"&gt;passing by value, not by reference&lt;/a&gt;) and structures are stored in a &lt;code&gt;stack&lt;/code&gt;, which is much faster to access than the &lt;code&gt;heap&lt;/code&gt; (where our objects are stored). Also, because the structure is stored in a &lt;code&gt;stack&lt;/code&gt;, it does not increase the &lt;code&gt;ARC&lt;/code&gt; counter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clousure
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Non-escaping&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Better optimized&lt;/li&gt;
&lt;li&gt;Do not increase ARC counter&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Escaping&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When you assign clousure become escaping&lt;/li&gt;
&lt;li&gt;Require &lt;code&gt;self&lt;/code&gt; to capture context&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Exception
&lt;/h3&gt;

&lt;p&gt;Swift has no exceptions like other languages, the only exceptions left are in Objective-C, the main reasons are unstable operation, horrible performance and memory leaks&lt;/p&gt;

&lt;h3&gt;
  
  
  Layout and AutoLayout
&lt;/h3&gt;

&lt;p&gt;Layout - responsible for placing the view on the screen, and also serves as a process for calculating the frame.&lt;br&gt;
AutoLayout - Almost the same, but the calculation process is automatic.&lt;/p&gt;

&lt;p&gt;How often do you crash because of AutoLayout? And memory problems? And a console full of AutoLayout errors?&lt;/p&gt;

&lt;p&gt;These are the main reasons why auto layout is evil, but unfortunately it is very common, but nevertheless try to use the normal Layout.&lt;/p&gt;

&lt;p&gt;But please do not mix both in one project :)&lt;/p&gt;

&lt;h3&gt;
  
  
  UIView responsibility
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Display.&lt;/li&gt;
&lt;li&gt;Animations.&lt;/li&gt;
&lt;li&gt;Layout and AutoLayout.&lt;/li&gt;
&lt;li&gt;UIResponder.&lt;/li&gt;
&lt;li&gt;Hierarchy views&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  CALayer
&lt;/h3&gt;

&lt;p&gt;The two items in the UIView's area of responsibility are handled by CALayer. The main reasons for using it: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Optimizing&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Using GPU&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  UIResponder
&lt;/h3&gt;

&lt;p&gt;Handler of any user input in the UIKit application&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>uikit</category>
      <category>cheatsheet</category>
    </item>
  </channel>
</rss>
