<?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 Sharath Prabhal on Medium]]></title>
        <description><![CDATA[Stories by Sharath Prabhal on Medium]]></description>
        <link>https://medium.com/@sharathprabhal?source=rss-15f77690de18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JEgGpb2LriZ9oL0JCeXdTA.jpeg</url>
            <title>Stories by Sharath Prabhal on Medium</title>
            <link>https://medium.com/@sharathprabhal?source=rss-15f77690de18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:51:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sharathprabhal/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[Time Travel | Convert timezones faster than ever!]]></title>
            <link>https://medium.com/@sharathprabhal/time-travel-convert-timezones-faster-than-ever-e9fd406467d2?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9fd406467d2</guid>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[timezone]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[utilities]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Sun, 19 Apr 2020 20:20:49 GMT</pubDate>
            <atom:updated>2020-04-20T18:43:58.564Z</atom:updated>
            <content:encoded><![CDATA[<h4>The fastest way to convert timezones</h4><p><a href="https://timetravel.sharath.app/">Times have changed </a>(pun fully intended) — our entire social life looks different now. We haven’t met any of our friends in person in over 6 weeks. However, a new trend emerged — we’re taking more effort to keep in touch with family and friends. As an immigrant living in the US, I‘ve not been great at keeping in touch with folks back in India. With the newly found “free” time, we jumped on a <a href="https://medium.com/u/c4c2efc9bc0a">Zoom</a> with cousins across 3 continents for the first time ever and it was a LOT of fun. After a couple of calls, one problem stood out — it’s difficult to find a time that works for everyone.</p><blockquote>“It’s difficult to find a time that works for everyone”</blockquote><p>There are a few ways to do this but they were all clunky, bad UX, not work on mobile web or needed an app install or filled with ads.</p><p>So, I decided to build one with the following goals —</p><p>📱 No app/extension install and no account creation — Should be able to configure once, bookmark and come back later to my list of timezones anytime<br>🕒 No sliders, button press, etc — the simplest possible interactions<br>🚀 Super fast!<br>❤️ Simple yet powerful UX on web and mobile<br>🌎 Should be able to search by any city in the world — not have to remember exact timezone<br>🆓 FREE</p><h4>🥁🥁🥁</h4><h4>Introducing, <a href="https://timetravel.sharath.app/">Time Travel</a> — the fastest way to convert timezones</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TDMJtCj9kialWapGB8a_gQ.gif" /></figure><p>Time Travel does one thing only — convert timezones fast!</p><ol><li>Goto <a href="https://timetravel.sharath.app/">https://timetravel.sharath.app</a></li><li>Add a timezone</li><li>Swipe or hover to travel time</li><li>Enjoy</li></ol><p>Please DM me on Twitter with any feedback. Thanks in advance.</p><p><a href="https://twitter.com/sharathprabhal">Sharath Prabhal</a></p><p>I built and deployed this over a few hours and this could not have been possible without OSS and freemium software. A big thanks to</p><ul><li><a href="https://reactjs.org/">ReactJS</a></li><li><a href="https://www.typescriptlang.org/">TypeScript</a></li><li><a href="https://medium.com/u/d8c8c34e2236">Tailwind CSS</a></li><li><a href="https://medium.com/u/5250f9d9bd2f">Netlify</a></li><li><a href="https://medium.com/u/68f5136d3254">GitLab</a></li><li><a href="https://favicon.io/">Favicon.io</a></li></ul><p>Thanks for checking it out!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0YXnkyG4pC6E1VMDPuB_w.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9fd406467d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to split your serverless.yml]]></title>
            <link>https://medium.com/@sharathprabhal/how-to-split-your-serverless-yml-4e0b3d743c80?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e0b3d743c80</guid>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Tue, 30 Apr 2019 18:35:51 GMT</pubDate>
            <atom:updated>2019-04-30T18:35:51.785Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to split your serverless.yml with shared resources when you hit the 200 resource limit on AWS CloudFormation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0jGxAiVxDbAwVjSC" /></figure><p>I ran into the dreaded “200 resources limit” on AWS CloudFormation. This article discussed how to workaround it.</p><p>All of <a href="https://dashone.app/">DashOne</a>’s back-end runs on AWS and uses <a href="https://aws.amazon.com/cloudformation/">AWS CloudFormation</a> via <a href="https://serverless.com/">serverless</a> to manage the infrastructure. This is my first time using this backend strategy and I am very happy about it. However, after a few weeks of smooth usage, I ran into the dreaded “200 resources limit”.</p><p>You should check out this great <a href="https://serverless.com/blog/serverless-workaround-cloudformation-200-resource-limit/">article</a> which gives the backstory on the error and discusses various workarounds. Based on that, I chose to split the service into smaller microservices. That’s easy enough to do. Hint: It wasn’t. Why? Because the article does not explain what to do when you have shared resource i.e. resources(DynamoDB) created in one service but used in another.</p><p>Continue reading on DashOne’s <a href="https://dashone.app/">blog</a> …</p><p><a href="https://blog.dashone.app/splitting-up-aws-cloudformation-when-you-hit-the-200-resource-limit/">How to split your serverless.yml with shared resources when you hit the 200 resource limit on AWS CloudFormation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e0b3d743c80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Idea: Rent the Runway for business trips]]></title>
            <link>https://medium.com/@sharathprabhal/idea-rent-the-runway-for-business-trips-5554ad8db792?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/5554ad8db792</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[sharing-economy]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Thu, 28 Mar 2019 14:53:51 GMT</pubDate>
            <atom:updated>2019-03-28T15:02:02.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*OU9NbMvJSyxSJ13SHDIcQg.jpeg" /></figure><h3>What</h3><p>A service that will deliver clothes directly to your hotel or AirBnB at check-in and pick up the used clothes when you check out.</p><h3>Why</h3><p>Let’s take the example of a startup founder who is away 3 nights for work. Most importantly, she does NOT have a corporate expense account. Every dime she saves during this trip will help keep her startup afloat. Back to her trip — She needs business suits for formal meetings during the day and casual outfits for the evening. She also needs her essentials, accessories, shoes etc etc., you get the point. Next step is to fit all this into a tiny carryon bag, ugh, Good luck! How will this service help with that?</p><p><strong>Baggage cost and time (💰🕰)<br></strong>Imagine not having to carry an extra bag? On an average, US based airlines charge you $25 for an extra bag. Additionally, If you don’t check-in an additional bag, you don’t have to wait at the baggage carousel for 15 minutes! Win-Win.</p><p><strong>Take advantage of new flight options (💰🕰)<br></strong>Some of the major airlines now have a “Basic Economy” option where you save $50 on an average for fewer options, one of which is no carry on bag. Again, no bag = no wait = save money.</p><p><strong>Style &amp; Confidence(💰🕰)<br></strong><a href="https://www.sciencedirect.com/science/article/pii/S0022103112000200">Research</a> shows that your clothing may boost your confidence and affect your performance. So, it could help to dress sharp for that business meeting. I know what you’re thinking, “I only have one nice suit, and it’s pointless for me to buy another $500 suit just for this one meeting”.</p><h3>How</h3><p>Surprisingly, this is the easy part. <a href="https://www.renttherunway.com/">Rent the Runway</a> has proved that people are open to renting clothes, a notion that would have sounded preposterous a few year ago. So, all we need is an UI to pick clothes, enter check-in/out dates and your hotel address and voila! — your clothes are waiting for you. I’ve obviously skipped over some details, but you get the idea.</p><h3>The Economics</h3><p>So, would this actually make sense financially?</p><p>Well, based on how RTR is doing <a href="https://www.forbes.com/sites/clareoconnor/2016/06/15/rent-the-runway-unlimited-women-founders-revenues/#1b277ca572e1">financially</a>, I’d say yes. It should be safe to assume that the added cost of working with the hotel/AirBnB host to get the clothes in and out will not cause a dent in the overall margins.</p><p>This is one of my “it’ll be so cool if ….” ideas and thought I’d share it. Hope, RTR builds this someday.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5554ad8db792" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get a free McDonald’s burger!]]></title>
            <link>https://medium.com/@sharathprabhal/get-a-free-mcdonalds-burger-fadfb2b346ba?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/fadfb2b346ba</guid>
            <category><![CDATA[ocr]]></category>
            <category><![CDATA[surveys]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[mcdonalds]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Mon, 13 Aug 2018 18:32:08 GMT</pubDate>
            <atom:updated>2018-08-15T12:37:33.940Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TLDR</strong>: A quick introduction to <a href="https://freemcdburger.com/"><em>freemcdburger.com</em></a>. If you don’t care and just need to provide feedback, click <a href="https://docs.google.com/forms/d/1Dc-IbXBufZrUiFEVprUfa31eneMZ9nSoe3dgdUHyBOQ">here</a>. Use this <a href="https://www.freemcdburger.com/public/sample-receipt.jpg">sample receipt</a> if needed.</p><blockquote>Ok, it’s not really free. McDonald’s has a “Buy 1 Get 1 Free <a href="https://www.mcdonalds.com/us/en-us/product/quarter-pounder-with-cheese.html">Quarter Pounder</a>” offer if you complete a short survey using the receipt from a previous visit. Sounds easy right?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*JjbdONlZUXqO2v7qkLeNoA.png" /></figure><h4>The problem</h4><p>Each McDonald’s receipt contains a 26-digit(?!?!) code which is awfully painful to enter in their website at <a href="https://www.mcdvoice.com/">mcdvoice.com</a>. Depending on your keyboard ninja skills, it could take a while to enter this code on a phone.</p><h4>The solution</h4><p>I built a tiny tool that will scan the receipt, use Optical Character Recognition(OCR) to retrieve the <strong>survey code</strong> and pre-fill the code in the McDonald’s survey site to get you started. That’s it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Xhz3Q9qu-xIrqbZpsGgcA.gif" /><figcaption>Created using <a href="https://gifslides.com/">gifslides.com</a></figcaption></figure><h4>What makes this special?</h4><ul><li>You don’t need to download an app, all you need is a web browser</li><li>The receipt is processed on your device, it is not sent anywhere.</li><li>You can give away this free burger to someone in need!</li></ul><p>That’s all folks. If you find this useful, please share with others.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fadfb2b346ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Status Switcher for Slack]]></title>
            <link>https://medium.com/@sharathprabhal/status-switcher-for-slack-9d2b8d9479e6?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d2b8d9479e6</guid>
            <category><![CDATA[utilities]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[widget]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[slack]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Mon, 15 May 2017 14:30:12 GMT</pubDate>
            <atom:updated>2017-10-11T01:36:58.038Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>It takes 7 taps and 30 seconds to update your status through the Slack mobile app.</blockquote><blockquote>It shouldn’t.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYxpaaHE-jUdlDOtwmnK0w@2x.png" /></figure><p><strong>TLDR</strong>: A quick introduction to <em>Status Switcher for Slack</em> iOS app. If you don’t care and just need to download, check it out in the <a href="https://itunes.apple.com/us/app/status-switcher-for-slack/id1234039479?ls=1&amp;mt=8">AppStore</a>.</p><p>If you use <a href="https://medium.com/u/26d90a99f605">Slack</a>, you’ve probably heard about the new custom status feature that was released in April 2017. If not, you should read their <a href="https://slackhq.com/set-your-status-in-slack-28a793914b98">announcement</a>. IMO, this is one of the most useful features in today’s distributed workplace. Thank you for building this, Slack! While the feature is awesome, it could do better on mobile. Let me tell you why…</p><h4>The Why?</h4><p>I try to be responsive on Slack during and outside of my business hours. My primary use of a <em>custom status</em> is to let my team know why I’m not replying.</p><p>My first <em>won’t respond</em> status is during my morning commute. I used to get into my car and switch my status to “🚗 Commuting”. After a few days, I realized it takes me 7 taps and 30 seconds to execute this simple mundane task!?!?! I also realized that the 4 default status messages provided by Slack aren’t the ones I’m frequently using. After giving it some thought over a few weeks, I decided to build a widget to simplify the process over a weekend. After a weekend of coding, Appstore review and Slack review — Tada!</p><p><a href="https://itunes.apple.com/us/app/status-switcher-for-slack/id1234039479?ls=1&amp;mt=8">Status Switcher for Slack on the App Store</a></p><h4>The What?</h4><p>Simple — Customize your top status messages and quickly set one.</p><p>Use the app to customize your top 4 status messages and use the widget to quickly set one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lvXBdSWUjZQd4LpZcJuPYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aaEe681OvN036KN-3GxqsQ.png" /></figure><h4>Where?</h4><p>In the <a href="https://itunes.apple.com/us/app/status-switcher-for-slack/id1234039479?ls=1&amp;mt=8">AppStore</a>!</p><p><a href="https://itunes.apple.com/us/app/status-switcher-for-slack/id1234039479?ls=1&amp;mt=8">Status Switcher for Slack on the App Store</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcards.producthunt.com%2Fcards%2Fposts%2F98779%3Fv%3D1&amp;url=https%3A%2F%2Fwww.producthunt.com%2Fposts%2Fstatus-switcher-for-slack&amp;image=https%3A%2F%2Fph-files.imgix.net%2F6411cd5c-245a-48d7-b99b-9c4c21dee1a9%3Fauto%3Dformat%26fit%3Dmax%26h%3D405%26w%3D500&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=producthunt" width="500" height="405" frameborder="0" scrolling="no"><a href="https://medium.com/media/c167a5f7695367dcb926c04c8ba96e5b/href">https://medium.com/media/c167a5f7695367dcb926c04c8ba96e5b/href</a></iframe><p>Thanks for reading. Please provide any feedback/comments below or tweet at <a href="https://twitter.com/sharathprabhal">@sharathprabhal</a> .</p><p>If you find this useful, tap the ❤️ below to spread the word.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d2b8d9479e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using SpriteKit inside a React Native app]]></title>
            <link>https://medium.com/the-react-native-log/using-spritekit-inside-a-react-native-app-abf49cb29e58?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/abf49cb29e58</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[spritekit]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Wed, 28 Dec 2016 20:55:34 GMT</pubDate>
            <atom:updated>2017-01-02T23:41:10.236Z</atom:updated>
            <content:encoded><![CDATA[<p>This article explains how to integrate a SpriteKit based game into a React Native app.</p><h4>Backstory</h4><p>I set out to build a simple 2D iOS game during my Christmas staycation to realize my long time dream of game development. You can find the game at <a href="http://playarroe.com/">playarroe.com</a> Having already developed <a href="http://www.eatornotapp.com/">Eat or Not</a> using React Native, it was my first choice for mobile app development. Though RN performance is awesome for simple transitions and animations, it’s not meant to be game engine. After some researching, I picked Apple’s <a href="https://developer.apple.com/reference/spritekit">SpriteKit</a> as my game engine.</p><blockquote>SpriteKit is a graphics rendering and animation infrastructure that you can use to animate arbitrary textured images, otherwise known as sprites. SpriteKit provides a traditional rendering loop that alternates between determining the contents of and rendering frames.</blockquote><h4>Setup</h4><p>First, setup the React Native project.</p><p>Follow the super simple instructions in the React Native <a href="https://facebook.github.io/react-native/docs/getting-started.html">docs</a> and you should see this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*A5pC_3RHen67R-cDO0WQ_Q.png" /></figure><p>NOTE: This post will work only on iOS 9.0 and higher due to SpriteKit limitations.</p><h4>The game!</h4><p>For the purpose of this demonstration, my goal is to pass a number<em> </em>from the RN app which will be displayed on the SK end. A timer on the SK end will send back a randomly generated number to RN. You can think of this as passing some config from RN to your game for bootstrapping and the game returning the score back.</p><p>Ok, enough talk, let’s start coding!</p><p><strong>STEP 1</strong>: Render a SpriteKit scene from ReactNative</p><p>Let’s create our base screen to launch the game. This is RN 101.</p><p>index.ios.js</p><pre>export default class RNSK extends Component {</pre><pre>  constructor(props) {<br>    super(props);<br>    this.state = {<br>      lastScore: 0,<br>    };<br>  }</pre><pre>  startGame() {<br>    // render game screen<br>  }<br>  <br>  render() {<br>    return (<br>      &lt;View style={styles.container}&gt;<br>        &lt;Text style={styles.text}&gt;<br>          Welcome to React Native SpriteKit demo!<br>        &lt;/Text&gt;<br>        &lt;Text style={styles.text}&gt;<br>          Last Score: {this.state.lastScore}<br>        &lt;/Text&gt;<br>        &lt;TouchableOpacity onPress={this.startGame.bind(this)}&gt;<br>          &lt;Text style={styles.text}&gt;<br>            START GAME<br>          &lt;/Text&gt;<br>        &lt;/TouchableOpacity&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*Vj_s4Xbet5YBlVrf9XVAeA.png" /></figure><p>For all you JS developers, here comes the complicated part — Swift coding! Let me come clean by saying that I’ve never done any Swift or SpriteKit before. But, once you understand things a bit, it’s actually surprisingly simple to wire things up. I just followed one of the many Swift and SpriteKits available online.</p><p>First, let’s start by creating a <em>GameScene.swift </em>inside XCode. This <em>scene</em> is where all the game logic will reside. For the sake of organization, I created a <em>group </em>inside XCode to hold all my game related files. Note the label that I’ve added that should display “GameScene” at the center of the screen when rendered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*dOf8OZXwcTqiDUiQ9T_56A.png" /></figure><p>Now, we need a <em>SKView </em>to<em> </em>present our scene. This will be the view that act as a controller from the RN side. I like to consider this as outside the game, so I created a GameView.swift at the top level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*AJh7AejP3wzTsjrdKn84BA.png" /></figure><p>Time to create the bridge between the native view and RN. I followed the <a href="https://facebook.github.io/react-native/docs/native-components-ios.html">docs</a> and came up with my <em>RCTGameManager.m</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*JgSw_vDhI_7aJdLUs7ma1Q.png" /></figure><p>Back on the JS side, lets load this view and see what happens</p><pre>const GameView = requireNativeComponent(&#39;RCTGame&#39;, null);</pre><pre>export default class RNSK extends Component {</pre><pre>constructor(props) {<br>    super(props);<br>    this.state = {<br>      lastScore: 0,<br>      inGame: false,<br>    };<br>  }</pre><pre>startGame() {<br>    // render game screen<br>    this.setState({<br>      inGame: true,<br>    })<br>  }<br>  <br>  render() {<br>    if (this.state.inGame) {<br>      return (<br>        &lt;GameView <br>          style={{<br>            width: Dimensions.get(&#39;window&#39;).width,<br>            height: Dimensions.get(&#39;window&#39;).height,<br>          }}<br>        /&gt;<br>      );<br>    }<br>    return (<br>      &lt;View style={styles.container}&gt;<br>        &lt;Text style={styles.text}&gt;<br>          Welcome to React Native SpriteKit demo!<br>        &lt;/Text&gt;<br>        &lt;Text style={styles.text}&gt;<br>          Last Score: {this.state.lastScore}<br>        &lt;/Text&gt;<br>        &lt;TouchableOpacity onPress={this.startGame.bind(this)}&gt;<br>          &lt;Text style={styles.text}&gt;<br>            START GAME<br>          &lt;/Text&gt;<br>        &lt;/TouchableOpacity&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*sdQ4M8sLRiv5StbnzRFROw.png" /></figure><p>When you click on the <strong>START GAME </strong>game button, this is what you’ll see. Progress, but where the $^&amp;@# is the “GameScene” label that I added?!?!?!?.</p><p>Let me save you the hours of head banging :) So, when you render a view from RN through the bridge, RN will call <em>init() </em>on the view but will set the bounds on it at a <em>later time</em>. So, the scene that’s been rendered essentially has a width and height of 1. We need to listen for the changes in bounds and re-render the scene once it’s ready. Notice the <em>didSet </em>listener that I’ve added to the view bounds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*lMYFCdH_pg28EKWL7Jz74A.png" /></figure><p>Now, you’d see the label!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*7s9fOc74UOpBVOmhlcUNvQ.png" /></figure><p><strong>Step 2</strong>: Pass data from RN to SK</p><p>As stated in the <a href="https://facebook.github.io/react-native/docs/native-components-ios.html">docs</a>, lets modify a few files to include a property that will be passed in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*bKoY60HhP4W9RrCnTCbLWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*m00NAql_OjOhOcDQwi5a3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*AVg98F9CSC6R0miGOWSSkg.png" /></figure><p>Back in index.ios.js</p><pre>...</pre><pre>return (<br>  &lt;GameView <br>    input={this.state.input}<br>    style={{<br>      width: Dimensions.get(&#39;window&#39;).width,<br>      height: Dimensions.get(&#39;window&#39;).height,<br>    }}<br>  /&gt;<br>);</pre><pre>...</pre><p>Tada! you should see when you click on START GAME.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*13LqsWelmg6HKvbQLc02EA.png" /></figure><p><strong>Step 3</strong>: Pass data from SpriteKit back to RN</p><p>Again, as stated in the <a href="https://facebook.github.io/react-native/docs/native-components-ios.html">docs</a>, we’re going to use events.</p><p>Add the onEnd property to RCTGameManager.m and GameView</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*_vsnXHMajAASEetgNHHvNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*W5ZIG8vx4qNAFgitfCtrKg.png" /></figure><p>Note: In order for RCTBubblingEventBlock to be available in Swift, it needs to be imported in the Bridging-Header.h</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*_E8w5unqB3drqIxXqK5iSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*dbhD1tcfNEKGMcajOAc1gw.png" /></figure><p>Back in RN</p><pre>...</pre><pre>onEnd(e) {<br>    this.setState({<br>      lastScore: e.nativeEvent.score,<br>      inGame: false,<br>    });<br>  }<br>  <br>  render() {<br>    if (this.state.inGame) {<br>      return (<br>        &lt;GameView <br>          input={this.state.input}<br>          onEnd={this.onEnd.bind(this)}<br>          style={{<br>            width: Dimensions.get(&#39;window&#39;).width,<br>            height: Dimensions.get(&#39;window&#39;).height,<br>          }}<br>        /&gt;<br>      );<br>    }<br>...</pre><p>Now, 1 second after clicking START GAME, you’d see a random number</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*6BpCcTL224M6-OcdxWL1eQ.png" /></figure><p>That’s all folks!</p><p>Hope this article helps you in some way. I intentionally glossed over the SpriteKit parts for two reasons — firstly, this article was not meant for that; secondly, I’m still a super beginner at Swift and did not want to share my half baked understanding.</p><p>All the code for this demo is available at</p><p><a href="https://github.com/sharathprabhal/RNSK">sharathprabhal/RNSK</a></p><p>Don’t forget to checkout the game at <a href="http://playarroe.com/">playarroe.com</a>.</p><p>Feedback/comments below or tweet at <a href="https://twitter.com/sharathprabhal">@sharathprabhal</a></p><h4>Hit the recommend button if you want others to read this.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*33OotvO8u9tVC3F9AyNYdA.png" /></figure><p>Check out other interesting React Native articles at</p><p><a href="https://medium.com/the-react-native-log">The React Native Log</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abf49cb29e58" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-react-native-log/using-spritekit-inside-a-react-native-app-abf49cb29e58">Using SpriteKit inside a React Native app</a> was originally published in <a href="https://medium.com/the-react-native-log">The React Native Log</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implement Snapchat like swipe navigation declaratively in React Native]]></title>
            <link>https://medium.com/the-react-native-log/implement-snapchat-like-swipe-navigation-declaratively-in-react-native-309e71229c89?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/309e71229c89</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Wed, 24 Feb 2016 12:22:24 GMT</pubDate>
            <atom:updated>2019-05-10T18:02:13.066Z</atom:updated>
            <content:encoded><![CDATA[<h4>Bottom line on top</h4><p>Implement a 4-way swipe navigation across views <strong>declaratively</strong> in under 20 lines, no Javascript!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*VRQjU9tW_yVUIp2TXuWscw.gif" /></figure><p>Though I don’t use Snapchat, I’m a big fan of their swipe navigation. I personally think more apps should implement swipe navigation as its easier on the thumb. With screen size increasing every new release, its getting harder to reach the buttons in the top nav. I could write a full story on my frustrations with mobile navigation patterns, but, that’s for another day…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_wcAWZ2_9Z353eaDO329g.jpeg" /><figcaption><a href="https://dashone.app/">dashone.app</a></figcaption></figure><p>My initial approach to this problem was fairly complicated. I thought I might have to do something custom and complex with the <em>Gesture Responder System </em>and have the views listen to gesture events and slide animate in and out. Hmmm, that sounds complicated. Should I? The answer is NO. The ReactNative community is awesome and there is most likely a module that exists to do most things or at the very least, something close.</p><p>I’ve used the <a href="https://github.com/leecade/react-native-swiper">react-native-swiper</a> component in a <a href="http://www.eatornotapp.com/">previous project</a> and loved it! I figured I can tweak it a little bit to meet my requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*FvCJ1iK7Ug7GfJU6kLL2lA.gif" /><figcaption><a href="https://github.com/leecade/react-native-swiper">https://github.com/leecade/react-native-swiper</a></figcaption></figure><p>As you might have already guessed, I’m going to remove the pagination buttons and dots to make it look closer to what I want. What’s even more awesome — the component supports vertical navigation too. All I had to do was nest a couple of swipers and <em>boom! </em>I have fully functional 4-way swipe navigation between views.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5048ce7740fe4acf85d25cbd9e8eb42/href">https://medium.com/media/d5048ce7740fe4acf85d25cbd9e8eb42/href</a></iframe><p>There’s a lot of boiler plate code here — the essentials are <strong>less than 20 lines </strong>of pure declarative JSX!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*VRQjU9tW_yVUIp2TXuWscw.gif" /></figure><p>Unfortunately, vertical navigation is not supported on Android yet. I might be taking a crack at it soonish.</p><p>Thanks for reading! Checkout my other <a href="https://medium.com/front-end-dev/progressive-image-loading-in-react-native-ecc88e724343">post</a> on progressive image loading in React Native too.</p><p>Feedback/comments below or tweet at <a href="https://twitter.com/sharathprabhal">@sharathprabhal</a></p><h4>Hit the recommend button if you want others to read this.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OC667U89iUlK8WclQrFcTw.gif" /></figure><p>Check out other interesting React Native articles at</p><p><a href="https://medium.com/the-react-native-log">The React Native Log</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=309e71229c89" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-react-native-log/implement-snapchat-like-swipe-navigation-declaratively-in-react-native-309e71229c89">Implement Snapchat like swipe navigation declaratively in React Native</a> was originally published in <a href="https://medium.com/the-react-native-log">The React Native Log</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Progressive image loading in React Native]]></title>
            <link>https://medium.com/the-react-native-log/progressive-image-loading-in-react-native-ecc88e724343?source=rss-15f77690de18------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecc88e724343</guid>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Sharath Prabhal]]></dc:creator>
            <pubDate>Thu, 11 Feb 2016 12:19:59 GMT</pubDate>
            <atom:updated>2019-05-10T18:00:52.143Z</atom:updated>
            <content:encoded><![CDATA[<p>An experiment to improve image loading experience on slower connections.</p><h4>Bottom line on top:</h4><p>Here’s a screencast of a simulated 3G experience. The basic <strong>Image </strong>component is used on the left pane and a custom component on the right. Like the enhanced experience on the right? Read on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*rn_ncgQOSICp21fb-GAouw.gif" /><figcaption>Simulated 3G network. Left: Basic ; Right: Progressive</figcaption></figure><p>I started working on an image centric app recently and quickly realized that the default <strong>Image </strong>tag is <em>plain </em>when it comes to user experience. When loading a decent size image, depending on the connection, it could take a few seconds before the image is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_wcAWZ2_9Z353eaDO329g.jpeg" /><figcaption><a href="https://dashone.app/">dashone.app</a></figcaption></figure><p>I wanted something similar to how Medium loads an image — show a gray placeholder before the image is loaded and gradually fade in the image. For example, this is the experience when loading an AWS S3 hosted 148KB <a href="http://www.eatornotapp.com/img/Home.png">image</a> from <a href="http://eatornotapp.com/">eatornotapp.com</a> on WiFi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*vDcvlGXIzDTbAsYqKZjOpQ.gif" /></figure><p>As you can see, the image load and render is not particularly pleasant. There are primarily two reasons</p><ol><li>The image takes a bit to load</li><li>As soon as the image loads, it is presented immediately which causes a “flash”</li></ol><p>Here’s the code used for the test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*TKHIh71i6sNQmB0IY-0m-A.png" /><figcaption>Loader component (<a href="https://gist.github.com/sharathprabhal/a21dd6aadcd21454b2b4">gist</a>)</figcaption></figure><p>My first step was to avoid the “flash” by writing a custom <a href="https://gist.github.com/sharathprabhal/a54565ee1ce42d332f09"><strong>FadeInImage</strong></a><strong> </strong>component to display a tiny fade in effect by hooking into the <a href="https://facebook.github.io/react-native/docs/image.html#onload"><strong>onLoad</strong></a> event of the <strong>Image</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*i6bOnaPYTWZodX-iQNjepw.gif" /></figure><p>This was great! Already feels better than what I had before. Here’s the code for the custom <strong>FadeInImage</strong> component. This can be easily tweaked to produce other effects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*6DBZEWxpcUGSDAzmWFapcg.png" /><figcaption>FadeInImage.js (<a href="https://gist.github.com/sharathprabhal/a54565ee1ce42d332f09">gist</a>)</figcaption></figure><p>However, this still isn’t a great experience on a slower connection. You see the placeholder for a few seconds before the actual image is available. So, I went back <a href="https://jmperezperez.com/about-me/">José Manuel Pérez’s</a> excellent <a href="https://jmperezperez.com/medium-image-progressive-loading-placeholder/">post</a> on how Medium implements progressive image loading. This is also somewhat related to how Facebook <a href="https://code.facebook.com/posts/991252547593574/the-technology-behind-preview-photos/">implements</a> image loading on mobile. The idea is simple — create a tiny thumbnail to display as a placeholder. In order to avoid pixelation, blur it! Now, the <a href="http://www.eatornotapp.com/img/Home.min.png">thumbnail</a> is 4KB compared to the original 148KB image.</p><p>Now, the <strong>ProgressiveImage </strong>component does two things, loads the thumbnail first, then loads and fades in the actual image when its ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*2a--uzohtO-glIMedYWpMw.gif" /></figure><p>Not too bad. However, you’re not seeing the real benefits since its on WiFi. Lets see the same image loading on 3G.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*Oq6OdAS9tJNwnCI9aRaFAg.gif" /></figure><p>Tadaaa! Now, that’s exactly what I wanted!</p><p>Here’s the code for the <strong>ProgressiveImage</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*jD_qYlBy3QFTNzl_EX17dA.png" /><figcaption>ProgressiveImageComponent.js. (<a href="https://gist.github.com/sharathprabhal/7c6ea1e337119cdf36fa">gist</a>)</figcaption></figure><p>To sum up, we went from a jagged slow image load and flash to a progressive pleasant image loading experience!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*rn_ncgQOSICp21fb-GAouw.gif" /><figcaption>Simulated 3G network. Left: Basic ; Right: Progressive</figcaption></figure><p>Thanks for reading the post. Please provide any feedback/comments below or tweet at <a href="https://twitter.com/sharathprabhal">@sharathprabhal</a></p><h4>Hit the recommend button if you want others to read this.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OC667U89iUlK8WclQrFcTw.gif" /></figure><p>Check out other interesting React Native articles at</p><p><a href="https://medium.com/the-react-native-log">The React Native Log</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecc88e724343" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-react-native-log/progressive-image-loading-in-react-native-ecc88e724343">Progressive image loading in React Native</a> was originally published in <a href="https://medium.com/the-react-native-log">The React Native Log</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>