<?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[iOS Expertise - Medium]]></title>
        <description><![CDATA[iOS Development, Interview Preparation, MobileApps concepts - Medium]]></description>
        <link>https://medium.com/ios-expertise?source=rss----4ace815ede7d---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>iOS Expertise - Medium</title>
            <link>https://medium.com/ios-expertise?source=rss----4ace815ede7d---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 13:31:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ios-expertise" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[iOS Important Questions (Part 1)]]></title>
            <link>https://medium.com/ios-expertise/ios-important-questions-part-1-2794191660e3?source=rss----4ace815ede7d---4</link>
            <guid isPermaLink="false">https://medium.com/p/2794191660e3</guid>
            <category><![CDATA[ios-interview-question]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[interview-questions]]></category>
            <dc:creator><![CDATA[Abhishek Kumar]]></dc:creator>
            <pubDate>Wed, 21 Oct 2020 07:56:36 GMT</pubDate>
            <atom:updated>2020-10-21T08:35:13.293Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS Interview Questions (Part 1)</h3><p><strong>Q1: Difference between setNeedsLayout and layoutIfNeeded ?</strong></p><p><strong><em>setNeedsLayout</em></strong>: Invalidates the current layout of the receiver and triggers a layout update during the next update cycle. Because this method does not force an immediate update, but instead waits for the next update cycle, you can use it to invalidate the layout of multiple views before any of those views are updated. This behavior allows you to consolidate all of your layout updates to one update cycle, which is usually better for performance.</p><p><strong>layoutIfNeeded: </strong>Lays out the subviews immediately, if layout updates are pending. Use this method to force the view to update it&#39;s layout immediately.</p><p>Used mostly when updating the constraints of views/subviews dynamically at run time, these methods are used to update the constraints on the views.</p><p><strong>Q2: What are content compression resistance and hugging priority and how it works?</strong></p><p><strong>Content Hugging Priority:</strong></p><p>Sets the priority with which a view resists being made larger than its intrinsic size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*_u3DcxSOoXtOV19weXrmhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*WNIrIwPHIkLCcuZux1QRTQ.png" /></figure><p><em>Hugging priority comes into action when available size is more than the total size of the content.</em> Label 2 with higher priority hugs its content more and make the Label1 expand more than its intinsic content. Content Hugging priority for Label 1 is 250 and for Label 2 is 251. So Label 2 having more hugging priority will resist being larger than its content (intrinsic size). Label 1 will expand in size beyond its intrinsic size in order to satisfy the constraints.</p><p><strong>Compression Resistance Priority :</strong></p><p>Sets the priority with which a view resists being made smaller than its intrinsic size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*zCtbPu0dfdaTovUOC5TtXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*uCP_3eMN8XrJ6zQT3IPK8A.png" /></figure><p>Here Label 1 compression resistance is greater than label 2 so label 1 will not truncate and it’s size will not be decrease beyond it’s intrinsic size and Label 2 will truncate instead to maintain the constraint rules.</p><p><strong>Q3: What are Size Classes and how it can be used to design user interface for different screen sizes in portrait and landscape mode ?</strong></p><p>Size Classes are the iOS method of creating adaptable layouts that look great on all sizes and orientations of iPhone and iPad. With Size Classes, you don’t think about orientation or even device size. You care about whether you are running in a compact size or regular size, and iOS takes care of mapping that to various device sizes and orientations. The system defines two size classes, <em>regular</em> (denotes expansive space) and <em>compact</em>(denotes constrained space), which describe the height and width of a view.</p><p>A view may possess any combination of size classes:</p><ul><li>Regular width, regular height</li><li>Compact width, compact height</li><li>Regular width, compact height</li><li>Compact width, regular height</li></ul><p>Using these combination as a developer we can handle UI for all the screen sizes with different orientations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*P8uX92tVSUAztUCPcyGJIg.png" /></figure><p><strong>Q4: What are IBDesignable and IBInspectable ?</strong></p><p>The <strong>@IBInspectable</strong> keyword lets you specify that some parts of a custom <strong>UIView</strong> subclass should be configurable inside Interface Builder. Only some kinds of values are supported (booleans, numbers, strings, points, rects, colors and images) but that ought to be enough for most purposes. it’s possible to build a custom interface for configuring your custom controls and have them rendered in real-time while designing your project.</p><p>Using IBDesignable class, and IBInspectable properties it is easier to use the custom views in interface builder (xib / storyboard) and change the properties in interface builder, We don’t need to run and check the shape, size and color of our custom views. It can be done through the interface builder.</p><p><strong>Q5 : What are StackView and How to use them ?</strong></p><p><strong>UIStackView</strong> gives us: a flexible, Auto Layout-powered view container that makes it even easier to build complex user interfaces. It is a streamlined interface for laying out a collection of views in either a column or a row. Horizontal stack view can be used to lay out views horizontally and auto layout will be take care by stack view, Alignment, Axis, and Spacing can be used to change how views will look inside the stack view. Stack view need to be provided autolayout but it’s child doesn’t.</p><p><strong>Q6: What is BitCode ? Why you should enable it when uploading the app to app store ?</strong></p><p>Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.</p><p>By enabling the bitcode you ensure that all the performance/optimization done in the LLVM framework will recompile your app without asking you to upload the app again which will reduce the size of your app in future LLVM updates.</p><p><strong>Q7: How to reduce app size ?</strong></p><ul><li>Enable bitcode so that app can be recompiled by LLVM and LLVM framework improvements can be reflected in app binary without need to resubmit your app.</li><li>Use Asset catalog instead of directly putting images to folder.</li><li>Use On demand resource for images which are not used frequently.</li><li>Analyse your app size for compressed size (download size) and uncompressed size (Installed size) on app store connect for different variants.</li><li>Delete unused images and assets from your code.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2794191660e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ios-expertise/ios-important-questions-part-1-2794191660e3">iOS Important Questions (Part 1)</a> was originally published in <a href="https://medium.com/ios-expertise">iOS Expertise</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>