<?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 Sudip Kundu on Medium]]></title>
        <description><![CDATA[Stories by Sudip Kundu on Medium]]></description>
        <link>https://medium.com/@sudipkundu?source=rss-b86b8e2c022f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*afgQOaYlyR-38OIh.</url>
            <title>Stories by Sudip Kundu on Medium</title>
            <link>https://medium.com/@sudipkundu?source=rss-b86b8e2c022f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 01:35:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sudipkundu/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[Swift Properties]]></title>
            <link>https://medium.com/@sudipkundu/swift-properties-8adec36a4ad9?source=rss-b86b8e2c022f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8adec36a4ad9</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[iosdev]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Sudip Kundu]]></dc:creator>
            <pubDate>Sat, 26 Jan 2019 19:48:02 GMT</pubDate>
            <atom:updated>2019-01-26T19:48:02.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2yL1j2tnsQfF3a5OT3VaKg.png" /></figure><p><strong>What is properties?</strong></p><p>Properties associate values with a particular Class, Structure, Enumeration.</p><p><strong>Types Of Properties?</strong></p><ol><li>Store Properties.</li><li>Computed Properties</li></ol><p><strong>Rules Of Store Properties.</strong></p><ol><li>It can store constant(let) and variable(Var) as part of instance.</li><li>It can use only class and structure.</li></ol><p><strong>Note: we can provided default value on store property and we can modify the initial value for a store properties during initialization.</strong></p><p><strong>Example:-</strong></p><p><strong>struct</strong> FixedLengthRange {</p><p><strong>var</strong> firstValue: Int</p><p><strong>let</strong> length: Int</p><p>}</p><p><strong>var</strong> lengthOfrange = FixedLengthRange(firstValue: 0, length: 3)</p><p><em>// the range represents integer values 0, 1, and 2</em></p><p>lengthOfrange.firstValue = 6</p><p><em>// the range represents integer values 0, 1, and 2</em></p><p>Here FixedLengthRange class have variable stored property called firstValue and a constant store property called length whose value can’t be changed.</p><p><strong>Stored Properties of Constant structure.</strong></p><p>If we create an instance of a structure and assign it constant. Then we can’t modify the instance of properties, even they are declare as a variable properties.</p><p><strong>Example:-</strong></p><p><strong>let</strong> rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4)</p><p><em>// this range represents integer values 0, 1, 2, and 3</em></p><p>rangeOfFourItems.firstValue = 6</p><p><em>// this will report an error, even though firstValue is a variable property</em></p><p><strong>Rules Of Computed Properties.</strong></p><p>1. It can define class, structure and enumerations</p><p>2. It provide a getter and an optional setter to retrieve and set other properties and values indirectly</p><p>If you define a property as get { } inside the property declaration, it makes that property to a computed property.we can use computed properties in two types one is with get{ } inside the property and use both get { } and set{ }. If we define a property as a get{ } it’s called read only computed property.</p><p><strong>Example:-</strong></p><p><strong>With get{ }</strong></p><p><strong>var</strong> ComputedProperties:String{</p><p><strong>get</strong> {</p><p><strong>return</strong> “ComputedPropertes”</p><p>}</p><p>}</p><p>// — — — — — — — — — — — — — — — — — — — — — — — — — -</p><p><strong>get { } and set{ }</strong></p><p>// — — — — — — — — — — — -</p><p><strong>class</strong> sample {</p><p><strong>var</strong> no1 = 0.0, no2 = 0.0</p><p><strong>var</strong> length = 300.0, breadth = 150.0</p><p><strong>var</strong> middle: (Double, Double) {</p><p><strong>get</strong> {</p><p><strong>return</strong> (length / 2, breadth / 2)</p><p>}</p><p><strong>set</strong>(axis) {</p><p>no1 = axis.0 — (length / 2)</p><p>no2 = axis.1 — (breadth / 2)</p><p>}</p><p>}</p><p>}</p><p><strong>var</strong> result = sample()</p><p>print(result.middle)</p><p>result.middle = (0.0, 10.0)</p><p>print(result.no1)</p><p>print(result.no2)</p><p><em>// First result.middle get the value after the axis is set the value</em></p><p><em>//OutPut</em></p><p>(150.0, 75.0)</p><p>-150.0</p><p>-65.0</p><p><strong>Lazy Stored Properties</strong></p><p>A lazy stores properties is property whose initial value is not calculated until the first time it is used. It’s define with lazy modifier before the declaration.</p><p>Note: — it’s always declare a lazy property as a variable(var)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8adec36a4ad9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>