<?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 Roland Chan on Medium]]></title>
        <description><![CDATA[Stories by Roland Chan on Medium]]></description>
        <link>https://medium.com/@chan0123?source=rss-1a6ae481219f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rPvP408D4c8W8uCyArCFpQ.jpeg</url>
            <title>Stories by Roland Chan on Medium</title>
            <link>https://medium.com/@chan0123?source=rss-1a6ae481219f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 12:02:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chan0123/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[My FI Journey]]></title>
            <link>https://medium.com/@chan0123/my-fi-journey-606dccd35b9e?source=rss-1a6ae481219f------2</link>
            <guid isPermaLink="false">https://medium.com/p/606dccd35b9e</guid>
            <category><![CDATA[financial-independence]]></category>
            <category><![CDATA[financial-planning]]></category>
            <dc:creator><![CDATA[Roland Chan]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 06:01:01 GMT</pubDate>
            <atom:updated>2020-08-04T18:01:51.868Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZ3v8GeswX6BBWbK7uC_KQ.jpeg" /></figure><p>There are a lots of FI blog around, why do I start writing about my FI journey? There are two reasons: First, I would like to record my journey, so that I would not miss in the future. Second, I would like to share my knowledge as well as seeking advice from others. Interesting enough, among my friends or co-workers, very few have FI concepts. So I rarely discussed FI with others and always wonder if I am on a right track. I think using this channel, I would learn more by sharing my experiences.</p><p><strong>Myself</strong>:</p><ul><li>Electrical Engineer that Lived in CA</li><li>Father of 3 kids</li><li>Own stocks/ETF/REIT</li><li>Own rental properties and hold a real estate license</li><li>Partner with friend to do a online SAAS micro business</li><li>Partner with friends to do a dessert restaurant</li><li>Bought a tutor business last year for my wife</li></ul><p>I think I have some experiences that other do not have in the FI community so that I can share in the future, especially on the business side. My goal is to become financial independent at age of 40, technically before birthday of 41. So I have around 3 years of time. I am not quite sure what I will do after I reach my numbers of FI. I think I will probably still work for a few more years, or I will focus on the SAAS project. But my goal now is to hit my FI numbers within 3 years.</p><p>The first thing I want to share is to <strong>know your goal</strong>. I kind of have the concept of financial independences right out of school. At that time, there are very few resources and I just have a feeling of working for the next 30 years seems wrong. Fortunately, without knowing the goals, I just start investing. With the compound effects, it is much better to start earlier. After I worked a couple years, finally got more information about financial independence. Without knowing the goal, it is very hard to be motivated and will get lost easily. And you cannot keep track of the progress as you don&#39;t know the destination. For FI, it translate to <strong>“How much do you need for financial independence?”</strong>. Do you know? Fortunately, it is not difficult to answer. You basically only need one information, <strong>“How much do you need per year?” </strong>You may say, I don&#39;t know how much I need per year. Just simply use your family income and time 70%, it will be roughly how much you need per year for financial independence. If you keep track of your monthly expense or roughly annual expense, it is even better as it is more accurate. The other price of information is safe withdraw rate, which mean how much percentage of the money you can safely withdraw annually without exhaust your fund. Sounds complicated? Don&#39;t worry, many people did the research and we know the number. It is generally 4–5%. I am more on the aggressive side on the safe withdraw rate, so I usually use 5%.</p><p>FI Fund x withdraw rate = annual expense</p><p>FI fund x 5% = annual expense</p><p>FI fund = 20 x annual expense</p><p>Let me give an example: in CA, the living standard is much higher, it may not apply to your case, but it is good to have a more realistic case, need around $10k per month, which is $120k per year for all expense. Assume the withdraw rate is 5%, that means:</p><p><strong>FI fund = 20 x $120k = $2,400,000 ($2.4 Mil)</strong></p><p>Yes. It is a lot of money, but that’s the goal you are aiming.</p><p>In summary, you can estimate your total amount need by multiplying your annual expense by 20 (5% withdraw rate) or by 25 (4% withdraw rate).</p><p>If you don’t know, please work on your number and compare with your net worth now. Then you know your progress towards financial independence. You maybe surprise to find that maybe you are 1/3 of the journey. Good Luck!</p><p>I will be sharing others information in the future, both for my records and share my experiences. Any comments are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=606dccd35b9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrate Custom Bootstrap theme in Rails]]></title>
            <link>https://medium.com/@chan0123/integrate-custom-bootstrap-theme-in-rails-9e78070e6ba?source=rss-1a6ae481219f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e78070e6ba</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[bootstrap]]></category>
            <dc:creator><![CDATA[Roland Chan]]></dc:creator>
            <pubDate>Tue, 01 May 2018 23:34:18 GMT</pubDate>
            <atom:updated>2020-01-24T07:39:31.225Z</atom:updated>
            <content:encoded><![CDATA[<p>Being a developer, we should spend our time mostly on functional code, nowadays, users also pay attention to the design of your web. So how to achieve that? Bootstrap themes are coming to my mind, but most bootstrap themes out there are just html template, how to fit in rails structure such as asset pipelines? How to import the custom javascript file? Here we will look into it, it is not difficult.</p><p>I am starting with this FREE template by Creative Tim:</p><p><a href="https://www.creative-tim.com/product/material-dashboard">Material Dashboard by Creative Tim</a></p><p>first, create a rails project.</p><pre>&gt;rails new rails-template<br>&gt;cd rails-template<br>&gt;bundle install</pre><p>generate a page controller with index action</p><pre>rails g controller page index --skip-stylesheets --skip-javascripts</pre><p>make root point to the new index page</p><pre># in routes.rb<br>root to: &#39;page#index&#39;</pre><p>Now is a good time to make sure it works fine</p><pre>&gt; rails s<br># go to localhost:3000 in web browser</pre><p>The browser should show something like this, now the root is pointing the page controller, index action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*6wFZQaZibhDlmvfwtyvQvw.png" /></figure><p>Now, you can open the downloaded theme folder, open BS4/examples/dashboard.html, then copy the body tag over to app/views/page/index.html.erb, if you launch the browser again, you will see a mess. Don’t worry, as the CSS and javascript are not setup correctly, there is no styles yet. We are going to fix it.</p><p><strong>Add necessary gems</strong></p><p>bootstrap, font-awesome and popper has gem which take care of the asset pipeline, so we can use those gems. Then we need to modify the application.css file, which is the manifest file of collection of all the required CSS files.</p><pre># in Gemfile<br>gem &#39;bootstrap-sass&#39;<br>gem &#39;font-awesome-rails&#39;<br>&gt;bundle install</pre><pre># copy the css over to /app/assets/stylesheets/material folder<br># in app/assets/stylesheets/application.css, add the following</pre><pre>*= require font-awesome<br>*= require material/material-dashboard.css<br>*= require material/demo.css</pre><pre># in app/views/layouts/application.html.erb, add the following line<br>&lt;%= stylesheet_link_tag &quot;<a href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons">https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons</a>&quot; %&gt;</pre><p>With that, reload the rails server and load the localhost:3000 again, you will see the style looks OK, but the charts are off. We will fix the javascript next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqzZuECbRH-AsTrJN2n-0g.png" /></figure><p>copy the js files into /app/assets/javascripts/material folder. You can look at the github link for the final folder structure.</p><pre># in Gemfile<br>gem &quot;jquery-rails&quot;<br>gem &#39;popper_js&#39;, &#39;~&gt; 1.12.9&#39;</pre><pre># in app/assets/javascripts/application.js</pre><pre>//= require jquery<br>//= require jquery_ujs<br>//= require popper<br>//= require material/bootstrap-material-design<br>//= require material/perfect-scrollbar.jquery.min<br>//= require material/chartist.min<br>//= require material/arrive.min<br>//= require material/bootstrap-notify<br>//= require material/material-dashboard<br>//= require material/demo</pre><p>When you reload the server, you should see all the widgets are working fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zjwHhJL3s23kgsuYoRCkw.png" /></figure><p>You can check out the final project in github:</p><p><a href="https://github.com/chan0123/rails-template">chan0123/rails-template</a></p><p>Thanks for reading and let me know if you have any comment or feedback.</p><p>You can also reference to this:</p><p><a href="https://viblo.asia/p/how-to-integrate-custom-bootstrap-theme-in-rails-l0rvmxrAGyqA">How to integrate custom bootstrap theme in Rails</a></p><p>If you have time, checkout my hobby project at <a href="http://www.thejustcast.com/">www.thejustcast.com</a>. It is a website allow you to use dropbox to host a podcast. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e78070e6ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To Roth or not to Roth… That is the question]]></title>
            <link>https://medium.com/@chan0123/to-roth-or-not-to-roth-that-is-the-question-44ae2270c598?source=rss-1a6ae481219f------2</link>
            <guid isPermaLink="false">https://medium.com/p/44ae2270c598</guid>
            <dc:creator><![CDATA[Roland Chan]]></dc:creator>
            <pubDate>Tue, 17 Feb 2015 07:20:30 GMT</pubDate>
            <atom:updated>2015-02-17T19:04:20.147Z</atom:updated>
            <content:encoded><![CDATA[<p>I am talking about IRA, there are two kinds of IRA: tradition IRA (I will just call it IRA for simplicity) and Roth IRA. IRA stands for individual retirement account, which obviously are accounts for retirement. IRAs has some levels of tax benefits, depending on your income level, there are different tax benefits for different IRAs. So in general, it is good to put money in IRA as you will get tax benefits. I always puzzled when deciding which IRA account to contribute? I recently has some new thoughts and want to share with medium community. First thing first, the basics.</p><p><strong>Why call “Roth”?</strong></p><p>From wikipedia, the Roth IRA was established by the <a href="http://en.wikipedia.org/wiki/Taxpayer_Relief_Act_of_1997">Taxpayer Relief Act of 199</a>7 (Public Law 105–34) and named for its chief legislative sponsor, Senator<a href="http://en.wikipedia.org/wiki/William_V._Roth,_Jr.">William Roth</a> of Delaware.</p><p><strong>Basics</strong></p><p><strong><em>Traditional IRA </em></strong>typically funded by pre-tax money, so the money you put in, typically does not need to pay tax. The contribution limit is $5500 (or $6500 if you are older than 50). Then the money is growing tax-free, so no tax reporting as long as it stay inside the account, the tax come into picture when you withdraw the money. You can withdraw your IRA account money penalty-free when you are at 59.5 years old, but the money you take out will be your income that year and is subject to income tax, the tax rate is depending on your income that year and future tax rate. So there is so-called “<strong><em>tax deferred</em></strong>”, mean the tax is deferred when you withdraw the money when you retire. If you take money before 59.5 age, then the money is subject to 10% penalty and those income will also be counted as your income. There are a few more details rules: if your income (file as single) is more than $70,000, then your contribution is not tax deductible, you can still put the money in, but using post-tax money, then afterwards it is the same, money still grow tax-free and subject to income tax when take out. Also, there is a minimum requirement distribution (MRDs) when you are age 70.5, so IRA is desperate to collect tax when you are 70.5.</p><p>A Quick summary for traditional IRA</p><ul><li>Contribute $5500 per year ($6500 if older than 50)</li><li>funded by pre-tax money (has restrictions)</li><li>no tax while money stay in account</li><li>tax as normal income when withdraw money</li><li>can start to withdraw penalty-free after 59.5 (10% penalty if withdraw before 59.5)</li><li>has minimum requirement distribution after age 70.5</li></ul><p><strong><em>Roth IRA</em></strong> has similar features that when the money stay inside account, it is growing tax-free. But it has a fundamental difference of the money that is funding the account. The money is funded by post-tax money, which mean tax is already paid for that part of money, then you will ask, what’s the point for putting money into Roth IRA? the answer is when you withdraw the money after age 59.5, there is no tax at all. What? no tax? Yes, there is no tax when you withdraw, in simple example, if you have $500,000 in Roth IRA at age 59.5, then you withdraw $500,000 at once, and there is no tax! Wha-la! <strong>Roth IRA is “tax-free”, which mean no tax when you withdraw during retirement</strong>. Looks like a great deal. There are some more restrictions, first, if you are single filers, your income (technically modified AGI) need to be less than $114,000 for a full contribution, you can visit the <a href="http://www.irs.gov/Retirement-Plans/Plan-Participant,-Employee/Amount-of-Roth-IRA-Contributions-That-You-Can-Make-for-2014">IRS link</a> for detail table. For the withdrawal rules, it is more complicated, you can withdraw the money you contributed at anytime without any penalty, only on the money that you contributed, confusing? Here is an example: in 2013, you contribute $5500 to Roth IRA account, then another $5500 in 2014, now at the end of 2014, your Roth IRA account has a balance of $14000 (as you have some gains), so how much you can withdraw without any penalty? The answer is $11000, as those are the money you contributed, it would become messy if you are not funding $5500 even and after a couple years, it is hard to keep track. Most brokers such as e*trade and fidelity will keep track for you and list the amount that you can withdraw without penalty. Moreover, there is no minimum requirement distribution during lifetime of the original owner.</p><p>A Quick summary for Roth IRA:</p><ul><li>Contribute $5500 per year ($6500 if older than 50, income restriction)</li><li>funded by post-tax money</li><li>no tax while money stay in account (same as traditional IRA)</li><li>no tax when withdraw money after 59.5</li><li>can withdraw anytime for the money that you contributed</li><li>no minimum requirement distribution (MRD)</li></ul><p>OK. So what about Tradition VS Roth?</p><p>I am a mathematical person, so I would like to start with some numbers:</p><p>Let’s compare a simple case: You are now age 30, assume you just contribute to IRA for only 1 year and then stop, annual return is 5%, and your federal tax rate and state tax rate combine 35% (federal 25% and state 10%), then you take out the money at age 60.</p><p>Roth IRA:</p><p>Contribute $5500 (after tax money)</p><p>30 years of 5% return: $5500 x 1.05^30 = $23,770</p><p>No tax when take out, so you will get $23,770 at age 60.</p><p>Simple enough? Let’s try with traditional IRA.</p><p>Traditional IRA:</p><p>Contribute $5500,</p><p>30 years of 5% return: $5500 x 1.05^30 = $23,770</p><p>Assume tax bracket is still 35% combined for federal and state (Big assumption):</p><p>When withdraw: $23,770 less 35% tax = $15,451</p><p>So traditional IRA lose obviously, right?</p><p>But wait, this is pre-tax money, so we need to calculate the equivalent amount: if you do not have traditional IRA, this $5500 will become $5,500 less 35% tax = $3,575, so you are saving $1,925, so for apple-to-apple comparison, you need to invest that money too. As you will put this money into a normal account which require to file tax every year, so the return rate will be smaller than 5%, assume tax rate is 35%, then your return will be around 5% less 35% which is around 3.25% or so. (I assume a worst case scenario that most of the transactions are short-term capital gain.)</p><p>1925 x 1.0325^30 = $5,025</p><p>So the total extra amount is: $15,451 + $5025 = $20,476</p><p>Roth IRA: $23,770 VS Traditional IRA: $20,476</p><p>So we can conclude Roth IRA win!</p><p>Is that really the case? I have a big assumption in the calculation, is that I assume the tax rate when retire is 35% (federal and state combined), but will that be the case? Let’s do the same analysis for tax rate is 20% combined. (currently for 2014, <a href="http://www.bankrate.com/finance/taxes/tax-brackets.aspx">federal tax bracket</a> 15% is income up to $73,800 for married file jointly)</p><p>Roth IRA is the same as before: $23,770</p><p>Traditional IRA is: $23,770 less 20% tax = $19,016</p><p>total extra amount is same as before = $5,025</p><p>Total tradition IRA = $19016 + $5025 = $24,041</p><p>You will see tradition IRA win this time for around $271</p><p>So the traditional IRA account value depends heavily on the tax rate when you retire. I did a chart to show the relationship of retirement tax rate and the value of the traditional IRA account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*OsozfCFt8E9n3nf-EZVdUw.png" /></figure><p>From the chart, you can see that in this particular example, the breakeven point is around tax bracket 20%. For the bracket like 10%, the traditional IRA will win by $2,648, which around 10% of your total IRA value.</p><p>Of course, no one has crystal ball and don’t know what their tax bracket at retirement. IRS keep raising the tax bracket once a while and maybe the lowest bracket is 20% 30 years from now.</p><p>But I have a theory for myself: if I am at higher tax bracket, say 30% (combined tax bracket, federal 25% and state 5%), which mean my family income from other retirement is pretty high, current reference in 2014 is $73,801 to $148,850. Do I care about the IRA portion has lesser value? Probably not, as those IRA portion is kind of a bonus to me. What if I am really poor and I solely depend on IRA account to fund my basic necessity? Then my tax bracket should be pretty low (finger crossed), probably in 10% or 15% range or even lower, then I got more money in traditional IRA, and I need the money so badly, so some extra money will be crucial to me. So my pick is to <strong>go for traditional IRA</strong> for most of my IRA account. There is a risk that the tax skyrockets when I retired, but I am willing to bare the risk.</p><p>In fact, I think Roth IRA still valuable, but for some very high-risk investment (I can explain more when I have time), Roth IRA are tax-free, which will win if you have really high return rate. Retirement account is not suitable for high-risk investment, but just for research or discuss point of view, it makes sense to have some high-risk investment in Roth IRA. So I am going allocate a very small amount for some high-risk investment in Roth IRA.</p><p>What is your strategy for the IRA account? I would like to hear it and discuss with you. If you find something wrong or confusing, please let me know too. Please comment or twitter me. Thanks a lot for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44ae2270c598" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publish Your Podcast In 3 Minutes]]></title>
            <link>https://medium.com/@chan0123/publish-your-podcast-in-3-minutes-7f1ed0681e48?source=rss-1a6ae481219f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f1ed0681e48</guid>
            <dc:creator><![CDATA[Roland Chan]]></dc:creator>
            <pubDate>Fri, 07 Nov 2014 18:26:42 GMT</pubDate>
            <atom:updated>2014-11-07T18:26:42.031Z</atom:updated>
            <content:encoded><![CDATA[<p>Do you want to host your podcast? Do you find it difficult to publish podcast? Now there is an easy way to do so, using dropbox and justcast, you can publish your podcast in less than 3 minutes.</p><p>Head over to <a href="http://www.thejustcast.com/">www.thejustcast.com</a> and click log-in on the right hand corner, then it will connect with your dropbox account, justcast will only has permission to read from the app folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iiqkFzVwt882vTqp9t6jGw.png" /><figcaption>Press “sign in” in the right hand corner</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*Ovj7URLRQFrT7CQA3aQBfw.png" /><figcaption>Connect to your dropbox account</figcaption></figure><p>Then in your dropbox, a folder call “App/justcast” will be created, and then each folder inside app/justcast is a podcast, then you can put mp3 files inside that folder. A folder called “App/justcast/example” will be created and contain a “sample.mp3&quot; file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*ZOxw_NwxSdti0UZKwDSG5Q.png" /><figcaption>Example folder showing the “sample.mp3&quot; file</figcaption></figure><p>This folder represent the podcast and every mp3 files inside is one episode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*nCBelpGzWfWvZY6iXMMgkg.png" /><figcaption>Justcast dashboard</figcaption></figure><p>Then now you can drag your new episodes inside the folder, in this example, I drag in 3 additional mp3 files. Dropbox will automatically sync to cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*8yfARd-LA1l87l-Sld8F6g.png" /></figure><p>Go back to justcast dashboard, and hit reload. The the podcast is instantly updated to have 4 episodes. And the podcast is ready to publish. Then you can click on the “RSS feed” button and share the RSS feed or submit to itunes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*Iwe4R1fqCvlrvTr05EuFeQ.png" /><figcaption>It will sync to dropbox instantly</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*OTPRNP6JGGAjH43T_ZYawQ.png" /><figcaption>Web players for playing the podcast</figcaption></figure><p>You can also edit the podcast details by clicking on the edit button. You can change the description and other related fields here. You can also upload an image for the podcast cover.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*UrlrGoRKvX8zJqCMni6z1Q.png" /></figure><p>If you want to change the title of the episodes, just change the filename in dropbox, then justcast will automatically update the name. Similarly, if you want to delete one episode, just delete the file in dropbox.</p><p>You can also find some simple report of your podcast such as the download count and subscriber count in the stat section.</p><p>I hope you enjoy it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f1ed0681e48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Missing DONE button in iOS ]]></title>
            <link>https://medium.com/@chan0123/missing-done-button-in-ios-d74810a409b1?source=rss-1a6ae481219f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d74810a409b1</guid>
            <dc:creator><![CDATA[Roland Chan]]></dc:creator>
            <pubDate>Sun, 01 Jun 2014 06:30:35 GMT</pubDate>
            <atom:updated>2014-06-01T06:30:35.623Z</atom:updated>
            <content:encoded><![CDATA[<h4>Tutorial for adding DONE button for numeric keypads</h4><p>When you are using or developing an iOS app, do you have the following question: Where is the DONE button for numeric keypad? Let me elaborate more:</p><p>When you are inputing some numbers, you will see the keypad like this, will you wonder what to do when you finish the number? Do you expect there is a “DONE button” somewhere?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*3HAARezGC0L5_bAdGt6FrA.png" /></figure><p>Here is what apple provides for english characters keyboard, you always find the DONE or RETURN button at the right lower corner which you can tap when you are done. Simply intuitive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*B84khObUikIyi7-em8BUsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*3RcBZXrYuHtmk5fq0fztIA.png" /></figure><p>When I am doing a update to my <a href="https://itunes.apple.com/us/app/real-estate-calculator/id569704710">real estate calculator app</a>, as most of the input are number, I used the numeric keypad a lot. I want user to have a easy and intuitive way to indicate they are done with the number input. So where is the DONE button for the numeric keypad? Then I look at some popular app to see how they solve this problem, this is zillow mortgage app and Trulia mortgage app, basically they added a DONE button in a extra row, also with the prev/next button. Jobs get done, but it seems make the keypad not stylish, is there a better way?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*yd2HivxLNqj-OJRso9AfXQ.png" /><figcaption>Mortgage App from Zillow</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*00TCEBKl0v7TJpjL6HrzUQ.png" /><figcaption>Mortgage App from Trulia</figcaption></figure><p>Wait, there is a empty button space in the left lower corner, is that a perfect place to put a DONE button there?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*g9ThWoGZUGvPNzpkhE27kQ.png" /></figure><p>Originally I would like to implement my own DONE button, then I just came across with this awesome <a href="https://gist.github.com/matt-curtis/28461ec559d495101be8">gist</a>. He did a good job to add the DONE button, thanks <a href="https://github.com/matt-curtis">Matt</a>. So I am going to provide a short tutorial for adding the DONE button.</p><p>This is the final image of the numeric keypad, which matching the style too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*jGWFUAjCgn9wUn3oV92hzQ.png" /></figure><p>I am not sure why Apple does not include the DONE button in the standard SDK, as this will create fragmentation as it is up to the developers to decide what to implement, I really hope that it will be fixed in coming iOS 8. Let me know if you know there is any reason not including the DONE button in the standard SDK.</p><p>Here is a short tutorial of using this gist. First, assume you already get a xcode project and some basic knowledge of iOS programming, then you go to visit <a href="https://gist.github.com/matt-curtis/28461ec559d495101be8">gist</a> and get two files: <a href="https://gist.github.com/matt-curtis/28461ec559d495101be8#file-numberpaddonebtn-h"><strong>NumberPadDoneBtn.h</strong></a><strong> </strong>and<strong> </strong><a href="https://gist.github.com/matt-curtis/28461ec559d495101be8#file-numberpaddonebtn-m"><strong>NumberPadDoneBtn.m</strong></a>, then<strong> </strong>copy these two files into your project area.</p><p>First, import the header file in the viewController.m file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*iEuRQU7wBMidWBma5WiDVA.png" /></figure><p>In the storyboard, drag a textfield to your desired view controller, in the attribute inspector on the right panel, select “number pad” for the keyboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*dQDi6P-nIedOB9uAUbIh-A.png" /></figure><p>If you compile and run it now, then when you click on the textField, then you will see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*4BqY15tUiYxHb8r4nyyvgw.png" /></figure><p>This is the default iOS behavior, now, we want to get a handle of the textField, you can open the assistant view, the control-drag the textField into the viewController file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*fQQtl258F4S8cBNRoerJIw.png" /></figure><p>In the viewDidLoaded method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*RBuu9hVq5FCjDpsjL4T_TQ.png" /></figure><p>First, create the numberPadDoneBtn using the initWithFrame method, the frame you provided does not matter as the code will calculate the correct frame for the button programmatically. Then you need to set the textField’s inputAccessoryView to numberPadDoneBtn. The inputAccessoryView is a way Apple provide for adding accessory view in any input method, which in this case, it is adding a DONE button accessory to number keypad. Details can be found in <a href="https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/InputViews/InputViews.html">here</a>.</p><p>Then it is done! Is that too simple? The reason it is so simple as the gist code will take care of all the heavy logic like finding the firstResponder and resign it. This will make the code really clean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*GsQrKXZDXxwLVqKYAu7VMQ.png" /></figure><p>Thanks for reading and hope you enjoy it.</p><p>Lastly, I like iOS programming and always want to learn more about iOS programming, one of the best way to learn is to teach and share knowledge. So I would like to start a iOS tutorial web site, and my idea is to use a series of tutorials (like 15-20 tutorials) to finish an fully-functional semi complicated app. All the tutorials will be part of the app, and each tutorial will focus on 1-2 specific iOS topic. So at the end of all the tutorials, you will finish a fully-functional iOS app. I am still at the phase of planning it, so if you have any comments like what kind of app you like or any ideas, please tweet me <a href="https://twitter.com/chan0123">@chan0123</a>. Any comments are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d74810a409b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>