<?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 Pavel Bogart on Medium]]></title>
        <description><![CDATA[Stories by Pavel Bogart on Medium]]></description>
        <link>https://medium.com/@heyybogart?source=rss-b9aac35f9ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_sL_wiZcfBqyoWlj.jpg</url>
            <title>Stories by Pavel Bogart on Medium</title>
            <link>https://medium.com/@heyybogart?source=rss-b9aac35f9ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:30:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@heyybogart/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[My Top Swift 4 Extensions You Might Like]]></title>
            <link>https://medium.com/@heyybogart/my-top-swift-4-extensions-you-might-like-ea10244c470e?source=rss-b9aac35f9ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea10244c470e</guid>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Pavel Bogart]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 12:49:27 GMT</pubDate>
            <atom:updated>2018-11-09T12:58:44.693Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FrHEmohZ9-AJZzsX5o86_g.jpeg" /></figure><p>Whenever I start building a new iOS app I transfer my favourite extensions from one project to another one. The more I code the more I realise how life becomes easier with these amazing helpers.</p><p>In this article I would like to share my favourite Swift extensions I use on daily basis.</p><p>Currently I work on migrating UI of the app from a storyboard to code and of course there are some handy dandy extensions I can’t live without.</p><ul><li>When you want to pin your view to the edges of the superview:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfYzuWiAwgr3W1QYGNFMyg.png" /><figcaption>Trailing and leading anchors are used when you handle different orienations. You might replace it with left and right anchors if your device orienation is only portrait.</figcaption></figure><ul><li>This one is used to set some specific constraints, width or height:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AiGlBnGxkyD8hca9t_Hsqw.png" /><figcaption>When you call the function on a view you might remove unused parameters as they become nil or 0 by default</figcaption></figure><ul><li>In case if you need to handle setting constraints with safeAreaLayoutGuide:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJ1u2RBg9Z-iYe2E3tJDHA.png" /><figcaption>NSLayoutAnchor is available since iOS 9.0 +</figcaption></figure><ul><li>It’s not necessary anymore to create a constant with cellId, all you need is to pass cell’s class name as a cell type with .self in the end:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wXwlc5dsnD7cI2yMz7fCtw.png" /><figcaption>Ex: tableView.register(CustomCell.self)</figcaption></figure><ul><li>A color extension is very useful when you want to save some space and make sure you pass a correct color code. You can specify RGB color:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hob9VfQZl2rtVCxzfGHn9g.png" /><figcaption>Assertions will be triggered to prevent passing an incorrect rgb value</figcaption></figure><ul><li>Also you can convert HEX to UIColor in this way:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PCxQVRNWbNoHZY4O8GRhig.png" /></figure><ul><li>When you programmatically create buttons, labels or textfields some of them you might customize with a convenience initialiser:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPYUPwpd1R1xGdbejUVXgw.png" /><figcaption>With this example in hands you can make the same initialiser for other UIView items</figcaption></figure><p>Extensions are very powerful and can be used in many other ways to make your code look cleaner, more readable and easy to understand.</p><p>This is my first attemp on Medium to put some knowledge and make someone’s life easier. I would appreciate any support from you guys and thanks for reading!</p><p>Enjoy your day and stay positive :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea10244c470e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>