<?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 Purushottam Chandra on Medium]]></title>
        <description><![CDATA[Stories by Purushottam Chandra on Medium]]></description>
        <link>https://medium.com/@puru478?source=rss-3987d16b74dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p-hz-Tx2VmT2l0wFr12xHg.jpeg</url>
            <title>Stories by Purushottam Chandra on Medium</title>
            <link>https://medium.com/@puru478?source=rss-3987d16b74dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:58:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@puru478/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[A brief introduction to the MVC Architecture in iOS]]></title>
            <link>https://medium.com/@puru478/https-medium-com-puru478-a-brief-introduction-to-the-mvc-architecture-in-ios-564598b2b232?source=rss-3987d16b74dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/564598b2b232</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Purushottam Chandra]]></dc:creator>
            <pubDate>Sun, 13 Aug 2017 03:55:38 GMT</pubDate>
            <atom:updated>2017-09-22T05:57:49.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pzo0xiLzIEI9TuwwPkdxVg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/tAKXap853rY?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"><strong><em>Alejandro Escamilla</em></strong></a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText"><strong>Unsplash</strong></a></figcaption></figure><p>Mobile app development architectures are quite similar to those of web development or any other programming based architectures. Hence, you will come across many articles with this topic. But in this article, I’ll mostly focus on the MVC App Development architecture, specific to <strong>iOS.</strong></p><p>Architecture, by definition means, the art or practice of designing and constructing buildings. But a more modern definition is, the art or practice of designing and constructing a particular entity. This entity could be anything, from supply chain processes, computer systems and protein molecules to human behaviour, political propaganda and environmental harmony.</p><blockquote>Basically, all you need to know, is that <strong>Architecture</strong> is the way a particular thing is designed and structured. It helps in creating a blueprint which enables others to follow that particular approach.</blockquote><p>If you’re a novice iOS Developer, you most likely know and use the MVC (Model View Controller) Architecture. It is not a statistic or something, its just because, MVC is an approach which comes instinctively to all programers and because you’ve just started developing iOS apps, you would be most comfortable with the MVC Architecture.</p><p>For those of you who don’t know what the MVC Architecture is, here’s an infographic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*K53ak-zpz0G9J4DWySUMqA.png" /><figcaption>Model View Controller Infographic (made using <a href="http://www.canva.com/"><strong>canva</strong></a>)</figcaption></figure><p>As you can see, the <strong>View</strong> <em>interacts</em> with the <strong>Controller</strong>, which in turn <em>updates</em> the <strong>Model</strong>. After this flow is complete, the Model <em>notifies</em> the Controller, which then <em>updates</em> the View. Does this sound gibberish to you? Don’t worry, you’re doing the exact same thing without knowing what you’re doing.</p><p>So to explain this in terms of an iOS Developer, the <strong><em>Model</em></strong> is where all the data is stored. It could be in the form of a database, or a structure or the networking related code. The Model, doesn’t have any logical code, it’s just a <em>blueprint</em> of how you would <em>store</em> your data. Basically, a it is used to communicate data from one controller to another, in a systematic manner. For example, throughout the entire App, you should technically have just <em>one </em>model defining the objects for a database. Another example could be using <strong><em>Singletons</em></strong> for collecting data from multiple screens and processing it for an <strong><em>API</em></strong>.</p><p>The <strong><em>View</em></strong> is what we call <em>XIB</em>’s <em>(interface builder)</em>, <em>UITableViewCells</em>, <em>UICollectionViewCells</em> and <em>UIStoryboards</em>, etc. Basically, something which is visual and that the user interacts with, directly. While dealing with the code, anything and everything which relates to the UI of your App, like <em>UIKit</em>,<em> AppKit</em>,<em> CoreAnimations and CoreGraphics</em>, come under the View Category. Also, the most important aspect about the View is that it is almost always reusable. Be it in the form of <em>UITableViewCells</em>, <em>Custom</em> <em>Views</em>, or <em>UIView</em> <em>Extensions</em>. Hence, make sure that the View component is generic and can be reused throughout the project /app.</p><p>The <strong><em>Controller</em></strong> is where the logic is written, modifications to the model are made, updates from the model is received, user actions from the view is received and notification to the view is dispatched. This doesn’t happen directly, but with the help of <strong><em>Delegates</em></strong> and <strong><em>Protocols</em></strong>. You can think of the Controller as the brain of the whole project. It is the main point of interaction <em>(binding point)</em> between all the various parts of the architecture.</p><p>So all in all, the MVC architecture makes the code testable to an extent and helps segregate chunks of code into their rightful component.</p><p>The most difficult aspect, is when you get confused as to what should go where? And trust me, that does happen quite often. But don’t worry, here are <strong><em>Five</em></strong> points for you to remember, which will help you, if you ever find yourself in this situation:</p><ol><li>The Model should act like a blueprint and should define the way in which the data is stored.</li><li>The Model should be injectable and reusable.</li><li>The View should be reusable and hence should be generic.</li><li>The Controller should not have any data structures or any form of data storing blueprint.</li><li>The controller should have the binding logic between the UI Component and the Data Storing component.</li></ol><p>I hope this makes understanding the MVC architecture, a little less complicated. Honestly, it will become more instinctive the more you practice this type of programming blueprint.</p><p>In the next article, I will be explaining the <strong>MVVM</strong> architecture followed by the <strong>VIPER</strong> architecture. So stay tuned.</p><blockquote>If you genuinely understood the concept that I was trying to explain in this article, then please do share the knowledge and this article with all your friends. If you have any doubts, please feel free to leave a comment below, and I will surely answer it. If you do not agree with something that I explained, please leave a comment below and we shall have a healthy discussion regarding the same. If you would like me to explain some topic, please do leave a comment below and I shall write an article explaining the same.</blockquote><blockquote>Hope you have a lovely day!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=564598b2b232" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>