<?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 Moe Burney on Medium]]></title>
        <description><![CDATA[Stories by Moe Burney on Medium]]></description>
        <link>https://medium.com/@moeburney?source=rss-67395f1008b4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MeZ2SiVfx3EQ1TekIMrc9g.jpeg</url>
            <title>Stories by Moe Burney on Medium</title>
            <link>https://medium.com/@moeburney?source=rss-67395f1008b4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:45:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moeburney/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 Seven Steps of Backend Development for Mobile Applications]]></title>
            <link>https://medium.com/@moeburney/the-seven-steps-of-backend-development-for-mobile-applications-6fdcf31d6079?source=rss-67395f1008b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fdcf31d6079</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Moe Burney]]></dc:creator>
            <pubDate>Tue, 24 Jan 2017 10:14:15 GMT</pubDate>
            <atom:updated>2017-01-24T10:14:15.810Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*wL76mz2O6X9t5Iur7y_CUA.jpeg" /></figure><p>If you’re building a backend for your mobile app, what steps do you have to take to get it done?</p><p>I would summarize backend development in 7 steps:</p><ul><li>Decide on backend and frontend responsibilities</li><li>Write the initial endpoints and get something working</li><li>Design the API and document it</li><li>Design and implement the database</li><li>Write a backend test script</li><li>Implement the API using a Programming language</li><li>Deploy</li></ul><p>Let’s go through each step in more detail.</p><p><strong>Decide on backend and frontend responsibilities</strong></p><p>For some types of apps, a backend is merely a data store for simple values. But for more complicated apps, you may have to do complex tasks on the backend rather than the frontend. Here are two cases where you would do complex tasks on the backend:</p><ul><li>Your data needs validation on the server. For example the user is trying to play an audio file but the server has to check if she has permission to play the file by checking against a database.</li><li>Your data interacts with other parts of the system (like the database). For example your app registers a user which has to update your user database, which sends a verification email to the user and also sends an email to your system administrator.</li></ul><p>There are other reasons you may do things on the backend instead of the frontend. The point is to figure this out, roughly, before you start.</p><p><strong>Write the initial endpoints and get something working<br></strong> <br>After you’ve decided on the responsibilities of the backend, it’s time to get something up and running. Actual server endpoints that you can connect to with your client.</p><p>Achieve this using the <em>backward backend technique</em>. This means writing stub functions for both the backend and your frontend app. Not the full API, but just enough so that you have a minimal working backend.</p><p><strong>Design the API and document it</strong></p><p>The third step is to design your backend API.</p><p>There is a lot of talk about designing RESTful APIs, but I don’t think you have to follow RESTful principles by the book.</p><p>Instead, just document clearly what every backend API endpoint should do. For each endpoint, document clearly what kind of values need to be provided by the client, and what kind of values will be returned by the backend.</p><p>Specify which values are mandatory and which ones are optional. For example, let’s say you have a <em>get_movies</em> endpoint, which returns a list of movies based on a date range. If a date range is provided by the client, it returns the movies created in that date range. If no date range is provided, it uses the past week from the current date. It is important to document this fact.</p><p>This may seem simple, but the key point is to document it and keep the <br>document up to date.</p><p><strong>Design and implement the database</strong></p><p>From your API document you can now figure out the structure of the data and how you will store it.</p><p>Go with MySQL for most cases.</p><p>Follow good data normalization principles, but go far enough with it that it<br>makes sense, and no more than that.</p><p><strong>Write a backend test script</strong></p><p>Write a quick test script in bash/curl or Python that verifies all of your backend endpoints are working.</p><p><strong>Implement the API using a Programming language</strong></p><p>Now it is time to build the API using a programming language. I prefer Python for this. (I go more into detail in my <a href="https://app.convertkit.com/landing_pages/141520">screencasts</a>)</p><p><strong>Deploy the backend</strong></p><p>You can deploy your backend using a cloud service like AWS to host your backend, or you could use a dedicated host. This is a large topic that I’ll definitely cover more in another article.</p><h3>Want more detailed lessons on how to build a backend? I’m giving away free screencasts on backend development for iOS developers. <a href="https://app.convertkit.com/landing_pages/141520">Click here to get the screencasts</a>.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fdcf31d6079" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing a Technology Stack for Your Mobile App Backend]]></title>
            <link>https://medium.com/@moeburney/choosing-a-technology-stack-for-your-mobile-app-backend-f2d10395adcc?source=rss-67395f1008b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2d10395adcc</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Moe Burney]]></dc:creator>
            <pubDate>Thu, 11 Aug 2016 10:48:25 GMT</pubDate>
            <atom:updated>2016-08-11T10:48:58.194Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jPl1rxr8a-EnNBSm.jpg" /></figure><p>You need a backend for your mobile app.</p><p>Do you use a BaaS like Firebase or roll your own custom backend?</p><p>If you’re rolling your own backend, what database to use? MySQL or MongoDB?</p><p>What about server hosting? EC2 or DigitalOcean?</p><p>I made the <strong>Backend Decision Making Matrix</strong> to help with some of these decisions.</p><p>Here’s the download link to the PDF:</p><p><a href="http://ausios.com/wp-content/uploads/2016/08/ausios-Backend-Decision-Matrix.pdf">Backend Decision Making Matrix</a></p><p>Feedback or suggestions appreciated!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2d10395adcc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieve iOS Networking Proficiency in 10 Steps]]></title>
            <link>https://medium.com/@moeburney/achieve-ios-networking-proficiency-in-10-steps-9891269cbfc1?source=rss-67395f1008b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9891269cbfc1</guid>
            <category><![CDATA[objective-c]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Moe Burney]]></dc:creator>
            <pubDate>Mon, 08 Aug 2016 12:35:57 GMT</pubDate>
            <atom:updated>2016-08-08T12:35:57.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*8oQJrmeoYJlNnjC_vhVtXg.jpeg" /></figure><p>Most iOS apps require at least some kind of network connectivity for data transfer, which means network programming is an important area to master as an iOS developer.</p><p>How to get on the path toward mastery?</p><p>I’ve found that the best approach to a learning topic in iOS — or programming in general — is to look at the topic from several different angles.</p><p>So in the spirit of viewing things with a wide perspective (rather than merely searching for “best practices”) I present to you 10 steps that can help you kick ass at iOS network programming:</p><h3>Step #1</h3><p>Watch the WWDC videos <a href="https://developer.apple.com/videos/play/wwdc2010/207/">Network Apps for iPhone OS Part 1</a> and <a href="https://developer.apple.com/videos/play/wwdc2010/208/">Part 2</a> where Quinn “The Eskimo” discusses best practices for building iOS network apps. Even though this talk is from 2010, it is still very relevant. Especially the segments about designing your UI properly for handling network failures, using asynchronous network requests, and run loops. <em>(Note: for some reason Apple’s streaming version is not working, so you may have to click “Resources” and then download the video. It’s worth it!)</em></p><h3>Step #2</h3><p>Read <a href="https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/WhyNetworkingIsHard/WhyNetworkingIsHard.html#//apple_ref/doc/uid/TP40010220-CH13-SW3">Designing for Real World Networks</a> to get an idea of how networks can be unpredictable and how Apple suggests you prepare for this. Most importantly, make the <a href="http://nshipster.com/network-link-conditioner/">Network Link Conditioner</a> tool your friend.</p><h3>Step #3</h3><p>Read <a href="https://grokswift.com/pageviewcontroller/">Adding an API-Backed UIPageViewController in Swift</a> by Christina Moulton to learn from a full working example of how UI code interacts with a backend API.</p><h3>Step #4</h3><p>Download and learn how to use <a href="https://www.charlesproxy.com/">Charles Proxy</a> or another proxy software so that you can debug network apps. These proxy tools allow you to see the network requests that your app is making at any given time while it runs.</p><h3>Step #5</h3><p>Read <a href="https://www.raywenderlich.com/110458/nsurlsession-tutorial-getting-started">NSURLSession : Getting Started</a> go through a tutorial that uses Apple’s official networking API.</p><h3>Step #6</h3><p>Read Ash Furrow’s <a href="http://artsy.github.io/blog/2015/09/24/mvvm-in-swift/">MVVM in Swift</a> to learn an alternative way of architecting your app from conventional MVC, and how calling the network fits into this architecture.</p><h3>Step #7</h3><p>Watch Chris Eidhof’s talk on <a href="http://www.thedotpost.com/2016/01/chris-eidhof-tiny-networking-in-swift">Tiny networking in Swift</a> to see how you can leverage features in Swift to make networking in iOS simpler but also more powerful, without relying on a heavyweight networking library.</p><h3>Step #8</h3><p>Read <a href="https://www.mikeash.com/pyblog/friday-qa-2014-03-14-introduction-to-the-sockets-api.html">Introduction to the Sockets API</a> by Mike Ash to get a deeper look at sockets in iOS and how the low-level sockets API works under the hood.</p><h3>Step #9</h3><p>Check out my own article on how to quickly get a Python backend API and connect it with your Swift code — <a href="http://ausios.com/ios-backward-backend/">The Backwards Backend Technique</a>.</p><h3>Step #10</h3><p>Gain proficiency in a tool that you can use to test network APIs, like <a href="https://curl.haxx.se/">cURL</a>, <a href="https://github.com/jkbrzt/httpie">httpie</a>, or <a href="http://www.getpostman.com/">Postman</a>.</p><p>Any additions you would make to this list? Let me know in a response.</p><h3>If you want to create powerful backend APIs without needing a third party service, <a href="http://iosbackends.com/">Click here to sign up</a> and be the first to know about my upcoming book on backends for iOS apps, plus get an early adopter discount!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9891269cbfc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Backend for Your iOS App Without Relying On Parse or Firebase]]></title>
            <link>https://medium.com/@moeburney/building-a-backend-for-your-ios-app-without-relying-on-parse-or-firebase-a90d605b3cb2?source=rss-67395f1008b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a90d605b3cb2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Moe Burney]]></dc:creator>
            <pubDate>Wed, 03 Aug 2016 09:19:14 GMT</pubDate>
            <atom:updated>2016-08-03T09:19:14.581Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*A4tOMm7HjWAvxbh9ONeiYw.jpeg" /></figure><p>You need a backend for your iOS app. With Parse closing shop, what to do now? Find a Parse replacement or build your own backend?</p><p>I am firmly in the “learn to build your own” backend camp.</p><p>Many developers advise not to build your own backend. After a BaaS shuts down, those developers scramble to find the next replacement BaaS. And then they’ll try to convince you to use a replacement BaaS too. But we all know the inevitable will happen all over again. One day you’ll get a surprise email from your BaaS provider informing you that they’re shutting down right in the middle of your new app version launch.</p><p>I remember the time that it happened to me — a BaaS that I relied on shut down. When I first saw the shut down email, I felt used. I felt betrayed. Then I felt angry. And as I fell into a downward spiral, I isolated myself. I binged on ice cream and listened to Celine Dion while sobbing in the shower. I should have seen it coming, but I got seduced by the illusion of convenience and stability that the service provided. But that’s all it was — an illusion.</p><p>So why do fly-by-night BaaS providers keep coming up and doing this to all of us poor mobile developers?</p><h3>The idea of building your own backend can seem overwhelming.</h3><p>Learning everything about building backends is a lot of work. This is why BaaS seems like a good option at first.</p><p>But if you want to break free of BaaS dependence and build your own backends instead, here’s the trick: don’t try to learn everything about backends! Start small.</p><p>When you built your first iOS “app”, you probably weren’t focused on making it scalable and maintainable. You didn’t stress out too much the first time those UITableview cells got recycled and showed the wrong data. You probably didn’t worry about whether your app should follow MVC or MVVM or MMVCM (I made that last one up). I’m willing to bet your first app probably never even made it past the simulator.</p><p>I recommend the same approach to building a backend : start small. Get something working first, no matter how small. And then build on that.</p><h3>The Backwards Backend method</h3><p>You don’t need to bury yourself in books about Python or Ruby and learn everything about servers before you can get a backend up and running. Designing the entire API, deploying it, and scaling — all those things can come later.</p><p>Do this first:</p><p><strong>Write a single iOS function that will make a call to your backend, even before you build the backend</strong></p><p>Here’s an example. Suppose you decide that your first function will make an API call that retrieves the messages of a particular user.</p><p>The following function, written in Swift, makes a POST request to ‘/get_messages’ on a local server that doesn’t exist yet (but will soon). Let’s look at the code for this function:</p><pre>func printMessagesForUser() -&gt; Void {<br>            let json = [&quot;user&quot;:&quot;larry&quot;]</pre><pre>            do {<br>                let jsonData = try NSJSONSerialization.dataWithJSONObject(json, options: .PrettyPrinted)<br>                <br>                let url = NSURL(string: &quot;http://127.0.0.1:5000/api/get_messages&quot;)!<br>                let request = NSMutableURLRequest(URL: url)<br>                request.HTTPMethod = &quot;POST&quot;<br>                <br>                request.setValue(&quot;application/json; charset=utf-8&quot;, forHTTPHeaderField: &quot;Content-Type&quot;)<br>                request.HTTPBody = jsonData<br>                <br>                let task = NSURLSession.sharedSession().dataTaskWithRequest(request){ data, response, error in<br>                    if error != nil{<br>                        print(&quot;Error -&gt; \(error)&quot;)<br>                        return<br>                    }<br>                    do {<br>                        let result = try NSJSONSerialization.JSONObjectWithData(data!, options: .AllowFragments) as? [String:AnyObject]<br>                        print(&quot;Result -&gt; \(result)&quot;)<br>                        <br>                    } catch {<br>                        print(&quot;Error -&gt; \(error)&quot;)<br>                    }<br>                }<br>                <br>                task.resume()<br>            } catch {<br>                print(error)<br>            }<br>        }</pre><p>This code makes a POST request to “http://127.0.0.1:5000/api/get_messages” with the username “larry”. Of course, if we run this code now it won’t work, because we haven’t created the endpoint “http://127.0.0.1:5000/api/get_messages” yet. That’s what we’ll do next.</p><p><strong>Install Flask (and Python if you don’t already have it)</strong></p><p>Check out the <a href="https://www.python.org/">Python</a> and <a href="http://flask.pocoo.org/docs/0.10/installation/">Flask</a> docs.</p><p><strong>Write the backend function</strong></p><p>Now, we have to create the get_messages endpoint for our iOS function to call. Here’s how it looks in the default Flask file, app.py:</p><pre>@app.route(&#39;/api/get_messages&#39;, methods = [&#39;POST&#39;])<br>def get_messages():<br>    json = request.get_json()<br>    if json[&#39;user&#39;] == &quot;larry&quot;:<br>        return jsonify({&#39;messages&#39;:[&#39;test1&#39;, &#39;test2&#39;]})</pre><pre>    return jsonify({&#39;error&#39;:&#39;no user found&#39;})</pre><p>This Python/Flask stub function is as simple as it gets. The @app.route <a href="http://thecodeship.com/patterns/guide-to-python-function-decorators/">decorator</a> at the top specifies that the function should correspond to the ‘/api_get_messages’ endpoint and that it should be a POST request. The body of the ‘get_messages’ function checks inside request.get_json(), a Flask function that returns a dictionary containing the values that were sent in the POST request. If the messages for the username ‘larry’ was requested for the ‘user’ parameter, then our function sends the client a JSON object dictionary that contains an array of strings “test1” and “test2”.</p><p>The get_messages function returns hardcoded JSON, but later on you can connect it to a real database. Before that, run the Flask server and the iOS client to see if your first building block for your backend is working. We’ll do that next.</p><p><strong>Run the local server</strong></p><p>We make sure app.py has the following:</p><pre>if __name__ == &#39;__main__&#39;:<br>    app.run(debug = True)</pre><p>Now you can run the app.py to start up the Flask server:</p><pre>Python app.py</pre><p>This starts the Flask server hosted on your localhost with the default port of 5000.</p><p><strong>Call the function from your app</strong></p><p>Actually <strong>seeing</strong> your backend API returning something will give you the motivation to keep going forward with your backend building adventures.</p><p>Run the “getMessages” Swift function that you wrote in the beginning — just stick it in your main view controller or app delegate, and re-factor later. Also, make sure you add this to your info.plist so that you can disable iOS transport security requirements in your development phase:</p><pre>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;<br>&lt;dict&gt;<br>    &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;<br>    &lt;true/&gt;<br>&lt;/dict&gt;</pre><p>Once you get the array {“test1”, “test2”} printed out on the console, you know that you’ve successfully called your own backend. If you’re not getting the output, tweak things up until you do.</p><p>If you’ve got this far, congratulations. With a bit more “filling in the gaps” (learning some more Python, plugging in an ORM for database queries), you now can write a backend without needing Parse or any BaaS service of any kind.</p><p>Is this oversimplified? Yes, what we just wrote is not a finished backend. Proper API design, database design, server maintenance, and scalability are all concerns that you will have to address as you continue your journey. But if you start backwards like this, you’ve got a foundation, and you’ve got control over your own system. And having that control is much better than being dependent on yet another third party provider that may pull the plug on you at any minute.</p><h3>You can create powerful backend APIs without needing a third party service. <a href="http://iosbackends.com/">Click here to sign up</a> and be the first to know about my upcoming book on backends for iOS apps.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a90d605b3cb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>