<?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 Kiruthika Selvavinayagam on Medium]]></title>
        <description><![CDATA[Stories by Kiruthika Selvavinayagam on Medium]]></description>
        <link>https://medium.com/@kiruthika_s?source=rss-be9e89347898------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*YXZWe6GW2TXam792.</url>
            <title>Stories by Kiruthika Selvavinayagam on Medium</title>
            <link>https://medium.com/@kiruthika_s?source=rss-be9e89347898------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 02:49:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kiruthika_s/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[The Dream, The Facebook.]]></title>
            <link>https://medium.com/@kiruthika_s/the-dream-the-facebook-b543f5a6f718?source=rss-be9e89347898------2</link>
            <guid isPermaLink="false">https://medium.com/p/b543f5a6f718</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[success]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Kiruthika Selvavinayagam]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 08:01:25 GMT</pubDate>
            <atom:updated>2020-08-01T08:01:25.029Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X51jYPje7rn5j8kUiP1_7A.jpeg" /></figure><blockquote>To the readers, if you’re here without experiencing my first part of writeup, I recommend to read it first before continuing here.</blockquote><p><a href="https://medium.com/@kiruthika_s/woman-wife-mom-whats-next-29f0e1c1a6fd">Woman, Wife, Mom &amp; What’s Next?</a></p><blockquote>As you’re continuing, I believe you read my first writeup of me being a <strong>Woman, Wife, Mom and What’s Next?</strong>. But, another part of me is The Dream Chaser. I know, most of us want to work for FAANG or build a startup. I always love engineering. I wanted to become an engineer. I am very much keen on solving problems. Facebook was a big opportunity for me. In this post, I’m sharing my experience throughout the interview process.</blockquote><p>Two months of my time started fading away. I was nearing my interview dates. I was able to prepare everything I intended to and kept the learning phase going even in the last days before my interview. I started by solving one or two technical problem-solving questions, but eventually, I was able to solve eight to nine problems a day by the end of two months. But I’ll never forget the every night preparation schedule. Usually, my baby sleeps on my lap and after she sleeps my husband handover me my laptop and I had to solve problems sitting on a bed. Laying her down was not an easy option at all at that time (so usually I do my preparation with my baby sleeping peacefully on my lap).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dwzvUBf6cpqPrV443tLzFA.jpeg" /><figcaption>My husband clicked this picture and said, “I want to remember the efforts you put in for this opportunity”</figcaption></figure><blockquote>The day is here! I planned this day two months back, what can go wrong? I’m all excited and confident enough to face the day.</blockquote><p>The first round was a screening round for an iOS Engineer. So, I had a few iOS-based questions and two problem-solving questions. The interview process went for almost 45 minutes. On the other side, the interviewer was very comfortable. All these helped me to give my best for those 45 minutes. Later, I explained everything to my husband. The way of my excitement, he was very confident I’ll be proceeding in further levels. By the same night, a mail confirmation on clearing the screening round made us all happy. Above all, they had shared detailed feedback about me and the interview. It was applauding and positive. I’m all boosted up to the next level.</p><h4><strong>The Pandemic</strong></h4><p>The next call supposes to be travel plans and procedures to the London office for the further rounds. Unfortunately, it didn’t happen due to COVID-19 pandemic. As the situations were getting worse across the countries, there were lots of travel bans and restrictions. Hence, all the on-site interviews are now remote (lots of companies even stopped their hiring process).</p><h4>Change of Plans</h4><p>There were four rounds of interviews. First and second rounds were coding, the third round was behavioural, and the fourth-round was system design. In the first two rounds, I’ll be using coding editors for problem-solving. The third round is behavioural, no issues. System design is supposed to be a whiteboard discussion. Facebook itself gave an option to purchase a whiteboard (available for reimbursement) or use Google tool. I was quite insecure about whether I will be able to deliver what I am supposed to convey. I very sure all these remote interviews will not match the in-room/in-person interview experience. With no options left, I scheduled the next rounds in two weeks. But what was coming in the next few days was worsening the situations.</p><p>Already, almost all the companies in Bangalore initiated Work From Home facility due to the rapid spread of COVID-19. Eventually, the Indian Government was also planning to impose a lockdown. Due to various reason, we travelled to our hometown before the Indian Government imposed the national level lockdown. We were expecting the lockdown for a week or two. Due to the different environment and all these on-going situations, I was not able to keep up the phase of learning. But I managed some time daily with the support from my family.</p><p>Within a few days, I realised internet connectivity in native was not reliable. I was telling myself, this is not the time for all these silly reasons. But as I communicated this with my recruiter, she assured me, they will postpone the process if there is any drop in the call. Next few days, my husband and family took care of this issue and somehow able to provide a better internet connection with a different network in a specific place of the room.</p><h4>Big Day</h4><p>On the day, the recruiter made a test call to make sure the internet connectivity is good enough before an interview call. The first round was problem-solving and few iOS-related questions. There were two questions to be solved in 45 minutes. It was similar to the first screening round. I solved both the problems before time and discussed lots of other iOS-related questions. After 45 minutes, the second round continued with a similar pattern of questions and time. In the second round, I completed my first question on time. But at the end of the interview, I was distracted by my kid crying. Even though I answered the problem, I was not able to complete it due to lack of concentration. Everyone around me was creating positive vibes, as the day ends, not solving the last problem started bothering me very much. Even though I knew the solution, I was not able to complete it due to my mistake.</p><p>With still lots of worries started the next day with the next two rounds. As usual, there was a test call to check my connectivity. The third round was behavioural. If I had to look at my past and want to improve one thing, it is behavioural round. It is easy and convenient for me to handle or solve a problem by myself rather than explaining to others and get it done from them. Let’s keep it this way I’m bad at describing things. Now you may wonder how am I writing this blog. Yes, I’m trying to get better at it. Before the interview process, I made my mind I’m going to share my experience so, let me be honest with my answers. And I kept the whole interview that way. We were discussing mostly the past work experiences, working conflicts, solving problems with people, achievements and so on.</p><p>I regained all my confidence at the end of my behavioural round.</p><p>With the same confidence, continued with system design round. I was requested to design an app. The app is with a few screens and functionalities. I gave my best, as my whole experience is in designing and building the application. After 45 minutes, had a large sip of water and explained everything that happened to my husband, and I can already see the smile and confidence in his face. He was excited and telling our kid, “<em>Momma cleared a big interview today, we’re going to London!</em>”. That had put a big smile in my face.</p><p>Within the end of the day, I wanted to convey how comfortable I was throughout the process. So, I drafted my experience and interview feedback to the recruiter in detailed email.</p><p>Within a few days, with lots of positive feedback from all the interviewers, the recruiter was explaining me in everything in detail. The feedback call took more than an hour.</p><p><strong>On the 23rd of April 2020, I received my offer from Facebook, London.</strong></p><blockquote>Patience, persistence, and perspiration make an unbeatable combination for success. — Napoleon Hill</blockquote><p><strong>I would like to thank all the interviewers for giving me a comfortable environment to showcase myself. I’m very much thankful to the recruiter, for providing me all the clarifications to my questions and guiding me through every process.</strong></p><blockquote>This write up is not to booze on my offer (neither me nor my talents). The purpose is to share my experience as a woman, wife and mom. Many talented women in tech give up on their career due to various reasons after marriage. I submit this as a motivational story to all such women.</blockquote><blockquote>Physical Strength(Hard Work), Mental Strength(Perseverance) and Spirutal Strength(Love &amp; Acceptance) are the keys to continuous growth.</blockquote><blockquote>— Rickson Gracie</blockquote><p><strong>I’ll be joining on the 03rd of August 2020. Wish me luck ;)</strong></p><p><em>Do share your similar experiences with me. I would love to hear from you.</em></p><p><em>I am Kiruthika Selvavinayagam. Reach out to me at </em><a href="https://twitter.com/kirthi_shalom"><em>Twitter</em></a><em>, </em><a href="https://www.linkedin.com/in/kirthishalom/"><em>LinkedIn</em></a><em> &amp; </em><a href="https://github.com/ITechRoof"><em>Github</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b543f5a6f718" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Woman, Wife, Mom & What’s Next?]]></title>
            <link>https://medium.com/@kiruthika_s/woman-wife-mom-whats-next-29f0e1c1a6fd?source=rss-be9e89347898------2</link>
            <guid isPermaLink="false">https://medium.com/p/29f0e1c1a6fd</guid>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[success]]></category>
            <dc:creator><![CDATA[Kiruthika Selvavinayagam]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 08:00:28 GMT</pubDate>
            <atom:updated>2020-08-07T18:04:53.168Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCUNk3f1jjheRprO-nlW9Q.jpeg" /></figure><p>One of the best parts of being a woman is to be a MOM. Guess what would be the worst of being a woman would be?</p><p><strong>BEING (IN A ROAD TO BE) A MOM</strong></p><p>When I meant the worst part, the changes within me, (both physically and mentally). The women’s who is being a MOM would know the difficulties during the pre and postpartum duration. Besides, what would a working woman have to say about this? Even now, I’m curious to ask every working woman about their experience of being MOM or the path they have been to become a MOM. Everyone has their own stories to get admired and to give respect.</p><blockquote>I also have a story to share about being a Women, Mom, and what came next was my dream!</blockquote><p>Most of the times, as working women, it is hard to keep things in control. I would say it is nearly impossible without the right partner. I have a loving husband, a peaceful job, (<em>I was working at Microsoft India Pvt Ltd as an iOS Engineer</em>) almost a happy life. Will it get any better? Indeed, I was PREGNANT. We have been married for just above one year. This moment added so much happiness in our life. During these days, I got a call from Google regarding a job opportunity in Europe. I was all excited and skeptical at the same time. I was asking myself,</p><blockquote><em>“Is this the right time for me to take this interview?”</em></blockquote><blockquote><em>“If I clear the process, will I be able to join?”</em></blockquote><blockquote><em>“What about maternity?”</em></blockquote><p>After so many thoughts, I decided not to take up the interview and informed recruiter I’ll take this opportunity after my maternity (that is almost a year). Meanwhile, during my maternity leave, I got a call from two different recruiters at Google. I was feeling down, that I may be losing these opportunities which, I may not get anytime sooner. But I Ignored. After all, the most awaited time happened in our life.</p><blockquote>We are blessed with a BABY GIRL.</blockquote><p>We want to cherish every moment of our life but, I was into the postpartum period. This time, I’m more like, feeling emotional and being skeptical about everything around me.</p><p>After a few months, I got a call from another recruiter. This time, it was from Facebook, London.</p><p>Now it’s more of a fight between my brain and heart.</p><blockquote><em>“Should I take this up?”</em></blockquote><blockquote><em>“Can I give my best?”</em></blockquote><blockquote><em>“The opportunity is big!”</em></blockquote><blockquote><em>“What if I do not clear the interview?”</em></blockquote><blockquote><em>“Your door doesn’t keep ringing all the time.”</em></blockquote><blockquote><em>“I am not even getting ‘ME’ time, will I get time to prepare?”</em></blockquote><p>And my heart goes like,</p><blockquote><em>“Are you mad? You have a 4-month-old baby.”</em></blockquote><blockquote><em>“By taking this opportunity, will I be able to take care of everything which is already on my plate?”</em></blockquote><p>With all these questions in my mind, it was just a rollercoaster, but my husband helped me to sort it out. He encouraged me to take this up, yet left the choices with me. With some future hopes, I decided to take it forward and scheduled it after two months as I needed time to prepare. I started planning my preparation schedules by writing down the list of topics I should cover after the big day!</p><p>Meanwhile, I had to join back my current company after my maternity leaves. I was afraid of my rejoining day! Due to postpartum stress, I do not remember most of my colleague’s name or the work I have done earlier. I was not sure how it would go.</p><p>On the first day, I was excited (just like a newbie) to be in the office. I was out of home after a long time. I finally get my own time. But for the first time, I was away from my baby. Will a good mom ever leave a child behind for a job? But I was very keen to keep my baby healthy. Hence, I wanted to keep her in breastfeed as much as I can. So, I pump breast milk in my office twice a day to keep her in breastmilk. I still remember that evening after my office, I said to my husband about how I felt the whole day. He helped me understand my capabilities and motivated me to keep it going.</p><p>Eventually, all these turned out to be my routine as I started focusing more on my mental strength. I could remember my colleague’s name. I did outperform in work and received appreciation from everyone around. Then my real happiness was, I spent every excess minute to take care of my baby, family and invested in learning as per my schedule. Fortunately, everything is going as planned. As routines kept going, I never forget to leave anything behind. Ramped up my current project and delivered better as days pass by while I pump milk for twice a day for 45 minutes each. Somedays, I felt so tired as I won’t get enough sleep for a day (even 2–3 hours of continuous sleep is like a dream). I was physically giving up, but mentally, I was getting stronger.</p><p><em>Well, this is not the end. Read my next write up below on my interview experience with Facebook, London.</em></p><p><a href="https://medium.com/@kiruthika_s/the-dream-the-facebook-b543f5a6f718">The Dream, The Facebook.</a></p><p><em>I am Kiruthika Selvavinayagam. Reach out to me at </em><a href="https://twitter.com/kirthi_shalom"><em>Twitter</em></a><em>, </em><a href="https://www.linkedin.com/in/kirthishalom/"><em>LinkedIn</em></a><em> &amp; </em><a href="https://github.com/ITechRoof"><em>Github</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29f0e1c1a6fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Push Notification on iOS simulator]]></title>
            <link>https://medium.com/@kiruthika_s/push-notification-on-ios-simulator-4c68bdfcb481?source=rss-be9e89347898------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c68bdfcb481</guid>
            <category><![CDATA[push-notification]]></category>
            <category><![CDATA[xcode11]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[simulator]]></category>
            <dc:creator><![CDATA[Kiruthika Selvavinayagam]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 06:40:14 GMT</pubDate>
            <atom:updated>2020-03-11T06:35:48.276Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello developers, I am happy to back with an update here. Apple has introduced a new feature in XCode 11.4 beta which helps in testing Push notification in the simulator.</p><p>Push notification conveys some essential pieces of information about the app. They increase user engagement. Gone are the days where we spend lots of effort into testing them. Earlier we test with a real physical device with some server that communicates with APNS. Now we can test these capabilities in the simulator in a few minutes.</p><p>Let’s learn about the way to test notification in a simulator.</p><h3>Getting Started:</h3><ol><li>Download the starter project from <a href="https://github.com/ITechRoof/PushNotificationDemo">here</a>.</li><li>Download <a href="https://developer.apple.com/download/">Xcode 11.4 Beta</a> (Only beta version was launched at the time of writing this blog). Xcode 11.4 Beta needs macOS Catalina 10.15.2 or later.</li></ol><h3>Code Walkthrough:</h3><p>Create a new “Single view app” project.</p><p>In the AppDelegate.m, import UserNotification.</p><pre>#import &lt;UserNotifications/UserNotifications.h&gt;</pre><p>Add the below piece of code in the <em>didFinishLaunchingWithOptions</em> method. This requests permission to receive notifications.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4484d3e851077b45f0c41136c0024c95/href">https://medium.com/media/4484d3e851077b45f0c41136c0024c95/href</a></iframe><p>Add below two methods to handle notifications.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3af5cabd79da36ede8dc2241c4d007b7/href">https://medium.com/media/3af5cabd79da36ede8dc2241c4d007b7/href</a></iframe><p>Toggle on the remote notifications by adding background modes to the capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XdB_9tHNURbJv1V6j6pMjQ.png" /></figure><p>Run the project.</p><p>The app would be requesting for permission on launch. Grant the permission by clicking “Allow” to test the notifications further.</p><h3>Preparing APNS payload:</h3><p>APNS payload is a JSON payload that contains information about the notification. You can find more information on APNS payload <a href="https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification">here</a>.</p><p>Sample APNS payload:</p><pre>{<br> “aps”: {<br> “alert”: {<br> “title”: “iTechRoof”,<br> “body”: “Here with a new notification on simulator”,<br> “sound”: “default”<br> },<br> “badge”: 1<br> },<br> “Simulator Target Bundle”: “ITR.PushNotification”<br>}</pre><p>Use your Bundle Identifier in the Simulator Target Bundle field. You can find your Bundle Identifier in the General Section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KT9JpyCsxf3sC5SZCmOSg.png" /></figure><p>Save the content with Notification.apns (You can use any name for this file).</p><h3>Testing the payload:</h3><p>Place the app in the background by clicking the Home button or by pressing Cmd + Shift + H.</p><p>Drag &amp; Drop the apns file to the simulator. It works in both foreground &amp; background mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*0zZ_UROkMhfObzLSm4Ifjw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Zn9qPo-MeCTEjgfe5xmaAQ.gif" /></figure><p>You can find your notification appearing on the simulator screen.</p><h3>Testing through terminal:</h3><p>You can also use the terminal to post notifications to a simulator.</p><p>You need a simulator identifier to test it using the terminal. Click Window -&gt; Devices and Simulators. Copy the identifier from the simulator which is been used currently. Right-click on the simulator -&gt; copy identifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ARaHM1Rw8E5Qesjr8iHTQ.png" /></figure><p>You can use the below command to post a notification.</p><pre>xcrun simctl push [COPIED_IDENTIFIER] Notification.apns</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*JstNU-WpyTz-4lWzo4pRpA.gif" /></figure><p>Now you would be looking at your notification on the simulator.</p><p>If you face an issue like below on simctl command, make sure your command line tools are on Xcode 11.4.</p><pre>xcrun: error: unable to find utility “simctl”, not a developer tool or in PATH</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CC-_o9TxAvki-pDpp6Cv3g.png" /></figure><p>At the time of writing this blog, notification on the simulator was not updating the badge count. Notification sound was not played when notifications are triggered.</p><p>Follow me on <a href="https://twitter.com/kirthi_shalom">Twitter</a> / <a href="https://github.com/ITechRoof">Github</a>. If you find this article helpful, like it &amp; share it with your friends.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c68bdfcb481" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[App Extension — Exploring Widgets]]></title>
            <link>https://medium.com/@kiruthika_s/app-extension-exploring-widgets-ec9fad0665dc?source=rss-be9e89347898------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec9fad0665dc</guid>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[ios-apps]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[widget]]></category>
            <dc:creator><![CDATA[Kiruthika Selvavinayagam]]></dc:creator>
            <pubDate>Mon, 21 May 2018 16:16:08 GMT</pubDate>
            <atom:updated>2018-05-23T09:03:27.806Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, It just feels so good to be here! Well if you want to know where I was till now just follow the link below.</p><p><a href="https://itechroof.wordpress.com/">https://itechroof.wordpress.com/</a></p><p>Let’s get started.</p><p>iOS now has version 11.3(while writing this post) but we’re gonna jump back to version 8 for this post and explore a feature which was introduced. Well, let’s not drag further. It’s called App Extensions.</p><p>We’re not gonna cover all app extensions, as every type itself can be a blog post. So, we’re gonna look about Today Widgets or most commonly known as Widgets. In this post, we’re gonna cover,</p><ol><li>What is App extension?</li><li>It’s types</li><li>The lifecycle</li><li>Restricted API’s</li><li>Today extension</li><li>Steps to create Today extension</li></ol><h3><strong>App Extension:</strong></h3><p>App extension provides a bridge to access the custom functionalities or content of our application to other applications includes system apps.</p><p>For better understanding let’s say, it is about performing a specific task such as share option to post a content/media from one app to another app or custom keyboard extension available to other apps/system itself.</p><h3>Types:</h3><p>Apple provides various app extensions. To explore all you can navigate to <strong>File -&gt; New -&gt; Target -&gt; Application Extension</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YVxADR5S9qiGRzQYIMXy0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkWYHB42XjjDubGH8BByXg.png" /></figure><h3>The Lifecycle:</h3><p>App Extension has its own lifecycle and an environment. It is not something similar to the normal application. But there is something you need to know about Containing app &amp; Host app.</p><p>The Containing app is the application which owns the extension. In our scenario, the app gonna have a today widget. So our app is called Containing app.</p><p>Host app is the application which accesses app extension. For example, let’s say, we have an app extension in our (containing) app. Now, apple photos have a share feature, on click of it, it will display the list of applications which can share the photo. In that, if our app extension is invoked to share the photo to our (containing) app, then Photos app is called Host application.</p><p>In the list of the shown apps, by clicking our application, the request will be sent to the app extension. The app extension will process the request and will terminate once it is completed its task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*1pfo-7eOJHqKqK7RdHETTg.png" /></figure><p>For the above diagram, once user presses share button, host app invokes the app extension. The extension provides functionality to post the photo to our app. During this process, the app extension will have its own view within the context of the host app (in our case, photos app). Based on the user input/request the extension will return the result back to the host app. The extension can also perform background process if necessary. Once the request is complete, the system terminates the extension.</p><p>As the extension can communicate with the host app, there will be a request from the host app to extension and a response from the extension to the host app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJ6ZZ_GxyU5TLJtGXZVVAw.png" /></figure><p>App extension and containing app do not communicate directly. App extension and its containing app communicate through a privately defined shared container. Typically containing app isn’t even running while a contained extension is processing the request from host app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-XXQmEDF1LVaDto5XszjA.png" /></figure><h3>Restricted APIs:</h3><ol><li>The app extension cannot perform long running background tasks. The limitations can vary based on the platforms.</li><li>It can send data through AirDrop but cannot receive from it.</li><li>It cannot access the sharedApplication object.</li><li>The app extension cannot use any APIs marked under NS_EXTENSION_UNAVAILABLE macro or similar unavailability macro.</li><li>It cannot use any APIs in an unavailable framework.</li><li>It cannot access the camera or microphone on an iOS device (except iMessage extension).</li></ol><h3>Today extension:</h3><p>As mentioned earlier, it is also known as Widgets. Today extension will engage the users within our app. It is possible even when containing app is not launched, app extension will display the latest and up-to-date app information in the Notification Centre and Lock screen. You can also access extension in the app’s quick action menu (using 3D Touch).</p><p>Let’s do some coding ;-)</p><h3>Steps to create extension:</h3><p>Create sample project with Single View App template.</p><p>Go to <strong>File &gt; New &gt; Target &gt; Application Extension &gt; Today Extension</strong> to create today extension.</p><p>Now this template would have created a folder with storyboard and view controller for today extension along with their info.plist and entitlements.</p><p>Let’s create some label to reflect our content in today widget. In the below demo app, I have considered creating a widget for a travel. I have created a label for the quote and another label to provide the details of the destination if it is selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*IbNeZRqsjOGCpK8ta-Swng.png" /></figure><p>As a next step, create a shared container between containing app and app extension. We will use app group for sharing contents.</p><p>Create app group in the developer account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pDkDmJ0Zd2tlO7JstYBqA.png" /></figure><p>Turn on app group capabilities on containing app and app extension target by navigating to <strong>Capabilities &gt; App Groups &gt; ON</strong>.</p><p><em>NOTE: Make sure to use same app group on both the target.</em></p><p>Now we can make use of UserDefault to access content between containing app and app extension.</p><p>Now, on-click of a button, the alert view will be shown with different destinations. On selection of destination, content is set on the shared container using UserDefault.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b0ad0e37b397c5d3db52f0f0c4b9bcf/href">https://medium.com/media/4b0ad0e37b397c5d3db52f0f0c4b9bcf/href</a></iframe><p>On app extension, same app group is used to access the shared content. WidgetPerformUpdate method checks for a new change in widget content. We determine changes in this method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebfa0aca06dfd906d0436d1fc0e8a273/href">https://medium.com/media/ebfa0aca06dfd906d0436d1fc0e8a273/href</a></iframe><p>The above code will access the app group with suite name and then access the corresponding content using a key. If the content is changed, it’ll reflect in the label and on completion, the handler will return the new data. In case of no content change, it’ll be returned with no data.</p><p>In order to make your widget as a collapsible and expandable view. Mention display mode as expanded.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c61cc3cffd348819e3c9f2b3c0d8ef63/href">https://medium.com/media/c61cc3cffd348819e3c9f2b3c0d8ef63/href</a></iframe><p>The above code will display show more in the widget. On-click of show more, <strong>widgetActiveDisplayModeDidChange</strong> method is invoked. Using <strong>preferredContentSize</strong>, we can adjust widget and height within the method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e35a09faad50f97eafac9fec2f8788f3/href">https://medium.com/media/e35a09faad50f97eafac9fec2f8788f3/href</a></iframe><p>The important note to be considered is Memory Management in Widgets. Memory leaks can cause the system to kill the widget. Maintaining the low memory as possible will improve the smoother and interactive performance.</p><p>Well, we did it. The widget should be up and be running by now. You can find the demo project <a href="https://github.com/ITechRoof/ITRTodayWidgetDemo">here</a>..Let me know if this post can be improved or whether it was helpful for you.</p><p>If you wanna more post like this and you think this was really helpful then give me some claps.</p><p>Follow me for upcoming posts. Claaapppsss…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec9fad0665dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>