Building your first Native iOs App with an API Backend


Published on

Published in: Education, Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Hi and welcome! This is build your first Native iOS app with a BaaS!
  • I ’ m Matt Dobson. I ’ m an engineer at Apigee. I love building apps, and creating tools that developers enjoy using.
  • Everyone have XCode installed? Simulators installed? Do you have your developer account up to date if you want to run it on a device?
  • I work at Apigee. I help create tools for developers to build apps, and manage data through APIs
  • We power the APIs of a bunch of large enterprises. These companies use internal and external developers to create awesome products.
  • We ’ ve been doing trainings similar to this for HTML5 and PhoneGap in the past, but now we are branching into the native development. This is our very first training ever for building on iOS.
  • We do this for free, because we want to show the developer community what the cutting edge of APIs and data management can do for their development process. We can do this for free because we make our money working with large enterprises to help manage their APIs and APPs.
  • Apigee is always free for developers. 25GB limit on storage for our hosted service. Our BaaS product is also open source so you can download, and quickly get running on your own cluster.
  • Here is today ’ s agenda. We ’ ll break in with an Objective-C and iOS primer. Where we ’ ll talk about Objective-C, and put together the UI of our app. Then we ’ ll add data storage capabilities using Apigee App Services. Lastly, we ’ ll look at what it would take to submit our app to the app store.
  • Have you developed on iOS before? Have you ever ran into stopping blocks? Is there something in particular that you had a hard time doing? Is there something you ’ d really want to learn in this class?
  • Time to break out some Objective-C!
  • What is Objective-C? It ’ s the primary language used to write iOS apps. There are other options and frameworks for writing iOS apps, but Objective-C is still the standard many app developers use on the Apple platform.
  • It ’ s object oriented. Everything in Objective-C is represented as an object. Objects interact with each other by passing messages back and forth. It ’ s way of thinking is very similar to Java, C#, C, C++, Python, Ruby, et al.
  • Code for apps are primarily contained in .h and .m files. .h files are header files that define what methods the class has, and the .m files contain the implementation of these methods.
  • Today you ’ ll run into objects that will have an NS prefix. This stands for NextStep the original creators of the language. The ongoing standard in Objective-C is to prefix your objects with either your initials or some other multi letter prefix so you have an idea of the object ’ s origin.
  • Reading Objective-C for the first time can be intimidating. You ’ ll see square brackets every where through the code. This is how methods are called. <Open up finished code sample, show off example of method call. Talk it through.>
  • Now lets download our project off of github. We ’ ve done a little bit of work for you, and will walk you through getting your app setup from start to finish. It ’ s a modified standard master-detail application. The app should compile, and run in the simulator but will crash if you begin to click around.
  • Download the sample at this jump link.
  • Today we ’ re going to build a simple list app that will keep track of all the books that we like. <Go through completed sample. Demo adding, deleting, viewing details of books, and other stuff. Maybe last minute add editing?>
  • First let ’ s get into Interface Builder and setup our app accordingly. Interface builder is the drag and drop tool that allows app developers to quickly setup user interface objects.
  • You ’ ll see a few of these terms thrown around in the code of an iOS app. Apps follow the MVC pattern where there are a separation of concerns between code that holds data, code that presents data, and code that communicates between presentation and data.
  • StoryBoards are the current standard for building interfaces in our app. It allows you to simple drag and drop UI elements into your app for use. It contains the full user interface definition of your application all in one place.<Take them through setting some stuff up.>
  • Before storyboards app developers had to worry about the presentation of their views between view controllers. We had to code all of our own transitions in our app. StoryBoards give us segues that easily allow us to easily define navigation through the application.<Go through setting up segues if possible in app.>
  • Our app is missing a segue. We want users to click the plus button and open a form modally in our app that will allow us to create a book.
  • Lastly we need to tell the story board what controllers handle what views. This is important when defining what data is presented by the UI, and what data is defined using the storyboard. While we ’ ve defined what controllers handle which views lets just take a look so you can see what is going on.
  • Apps are more fun with data! Lets look at integrating a BaaS into our app.
  • Apps today can ’ t do all the work on the device. Modern smart phones have constraints on memory, cpu usage, and network usage. A BaaS provides a simple way to use an API to integrate remote data storage efficiently into your app.
  • It ’ s essentially remote data storage you can access directly in your code.
  • Think of it as an iCloud or Dropbox that syncs your apps data across devices instead of documents or songs.
  • By using a lightweight library you can use API calls to Create, Read, Update, and Delete data with ease. The backend manages access and security through it ’ s API, and the server infrastructure make ’ s sure your data is backed up and safe.
  • In the code you ’ ll see references to UserGrid. UserGrid is an open source project acquired by Apigee a little over a year ago.
  • Before we can add BaaS to our app we need to sign up. Go to the link and sign up. After you ’ ve confirmed your account let ’ s go and play with the dashboard.
  • Add some data. Explain JSON and do a walkthrough of adding a book. Also explain the sandbox app is for learning and testing, but not production use.
  • We have tons of SDKs available to build apps on. They are all open source and we welcome contributions!
  • Okay now lets get some of the data we added in objective-c. Open app and add data retrieval code.
  • This is a two part answer 1. First we need to get all books on viewDidLoad execution. Then we need to display the @ ” title ” property of our book accordingly.
  • Now we can read data. Let ’ s have our device add data instead of using the dashboard. Walk users through writing create entity code.
  • We don ’ t want to keep books in our lists all the time. Let ’ s make sure we can delete books. Take users through removal code.
  • Now that we have a basic app completed. Let ’ s take a look at what it would take to submit it to the app store. I ’ d recommend you don ’ t submit this app. It ’ s a bit too basic for use in the app store just yet. You ’ ll also need an Apple developer account to interact with the app store.
  • Submitting an app is the most intimidating part. You have to walk through the creation wizards, and wait for Apple ’ s approval process to be completed.
  • First you need to create an app id. This holds app specific information like what apple services you want to take advantage of, and you ’ re globally unique bundle id.
  • Next you ’ ll want to generate a code signing certificate. This tells apple you are a registered developer with a specific app ready for submission to the app store. There is a similar process required for testing the app on the device.
  • Next you ’ ll need to create a production provisioning profile. This profile is used in conjunction with the certificate you created to install apps onto the device.
  • Next we ’ ll need to create the app in iTunes connect. This is where we upload icons, screenshots, app descriptions, and name our app. We ’ ll also go here to release it to the app store, and view how many downloads we ’ ve gotten.
  • Next is the waiting game. Apple takes between 2 weeks to a month to fully review an app and approve it for release into the app store. After every step of the review process you ’ ll receive an email that says it ’ s either passed or failed.
  • Once it ’ s ready and approved. Apple will email you with your approval, and you ’ ll have to enter iTunes connect to release your app to the store. It typically can take up to 48 hours to fully appear in the app store.
  • Congrats! You ’ ve just built a data driven app, and learned the app store submission process!
  • That ’ s a great first step, but what could we do next?
  • We can look at apple provided services, or apigee provided services to quickly build great data driven apps that users love. You can reach out to them with push notifications, give them contextually aware information using geolocation, have them setup profiles with user management, keep their data secure, work with files and pictures, or even build your own social graph! Apigee enables you to do all of this!
  • You could build your own
  • iCloud Store App or Social Network
  • You can easily scale to millions of users
  • Want more training? Reach out to [email_address] to get something online or in person organized for your user group, company, or other organization!
  • Join app craft to ask questions, share your app ideas, or help others in the process of designing and building their app!
  • Thanks! This is our first time doing the class so if you have feedback we ’ d love to hear it!
  • Thanks again!
  • Building your first Native iOs App with an API Backend

    1. 1. Build your first Native iOS app with an API Backend! twitter:@mdobs @timburks
    2. 2. Matt Dobson @mdobs Tim Burks @timburks
    3. 3. Do you have XCode installed?
    4. 4. I work @ Apigee.
    5. 5. We help power eBay Best Buy, Walgreens, Gilt Groupe, NewEgg,, Dell, Getty Images, GraceNote, Shazam, HomeAway, Pearson, cheezburger
    6. 6. We’ve organized trainings for HTML5, but this is our first for iOS!
    7. 7. Why do we do this? Why free?
    8. 8. Apigee is always free for developers. - Hosted (25GB limit) - Open-source (full) - Private clusters
    9. 9. 1.Objective - C 2.API Backend 3.App Store
    10. 10. Have you developed for iOS before? What do you want to learn today?
    11. 11. Objective-C
    12. 12. What is Objective-C?
    13. 13. Object Oriented.
    14. 14. .h and .m files
    15. 15. NS prefixes
    16. 16. Brackets, Brackets, Brackets
    17. 17. Download the project
    18. 18.
    19. 19. Our books app!
    20. 20. Setting up our UI
    21. 21. Model View Controller
    22. 22. Storyboards
    23. 23. Master-Detail App
    24. 24. Segues
    25. 25. Setup a segue in our app
    26. 26. IBOutlets
    27. 27. Setup outlets for our detail view
    28. 28. Set up Controllers
    29. 29. Build with a Backend.
    30. 30. Why use a Backend?
    31. 31. It’s remote data storage you can access in your code.
    32. 32. It’s like iCloud or Dropbox, because it lets you sync data across devices.
    33. 33. Server Infrastructure App Code SDK API
    34. 34. Usergrid? Apigee?
    35. 35. Let’s take a look at Apigee
    36. 36. Add some data
    37. 37. SDKs available for… JS, node.js, iOS, Android, Ruby, Rails, C#, Java, WP8, etc.
    38. 38. Getting data
    39. 39. Answer: and
    40. 40. Storing Data
    41. 41. Answer:
    42. 42. Deleting Data
    43. 43. Answer:
    44. 44. App Store
    45. 45. Submitting
    46. 46. Create App Id
    47. 47. Create Certificate
    48. 48. Create Provisioning profile
    49. 49. iTunes Connect
    50. 50. Approval Process
    51. 51. App Store Launch
    52. 52. Congrats!
    53. 53. What else can be done?
    54. 54. Push Notifications Geolocation User Management File Storage Picture Sharing Social Networking Security
    55. 55. Build your own...
    56. 56. iCloud Retail Store Social Networks
    57. 57. Scale to Millions
    58. 58. Advanced Class? Training for your company? Questions?
    59. 59. Ask for help! Announce projects! Sign up now :)
    60. 60. Thanks! We’d love feedback on how to make it better. Let us know!
    61. 61.