iOS Apps with REST APIs
by Christina Moulton
You need to build an iOS app around your team’s API, or integrate a
third party API. You need a quick, clear guide to demystify Xcode and
Swift. No esoteric details or mathematical analysis of
flatMap. Only the nitty gritty to get real work done now:
pulling data from your web services into an iOS app, without tossing
your MacBook or Mac Mini through a window. Just the bare facts to get
CRUD done on iOS. That’s what this book will do for you.
This work was written and produced entirely by the author. We are proud to be distributing it.
Get all eBook formats here for $29.00 (USD)
Add to Cart
After reading this book you’ll be able to:
- Analyze a JSON response from a web service call and write Swift code
to parse it into model objects.
- Display those model objects in a table view so that when the user
launches the app they have a nice list to scroll through.
- Add authentication to use web service calls that require OAuth 2.0,
a username/password, or a token.
- Transition from the main table view to a detail view for each
object, possibly making another web service call to get more info
about the object.
- Let users of your app add, modify, and delete objects (as long as
your web service supports it).
- Hook in to more web service calls to extend your app, like adding
user profiles or letting users submit comments or attach photos to
To achieve those goals we’ll build out an app based on the GitHub API,
focusing on gists. Your model objects might be bus routes, customers,
chat messages, or whatever kind of object is core to your app.
This book is for:
- Software developers getting started with iOS but experienced in
- Front-end devs looking to implement native UIs for iOS apps (no CSS,
- Back-end devs tasked with getting the data into the user’s hands on
- Android, Windows Phone, Blackberry, Tizen, Symbian, and Palm OS devs
looking to expand their web service-backed apps to iOS
- Anyone whose boss is standing over their shoulder asking why the
data isn’t showing up in the tableview yet
This book isn’t for:
- People completely new to programming—you should have a decent
grasp of at least one object-oriented programming language or have
completed several intro to iOS tutorials
- Designers, managers, UX pros … It’s a programming book. All the
monospace font inserts will probably drive you crazy.
- Cross-platform developers dedicated to their tools (including HTML5
and Xamarin)—this is all Swift and native UI, all the time
- Programmers building apps with no web service interaction
What You Need
This book was written in Swift 4.1, Alamofire 4.7, iOS 11 (with support
back to iOS 10), and Xcode 9.4. You’ll need Xcode 9 running on OS X.
- P3.0 2018/07/03
- P2.0 2016/11/09
- P1.0 2016/08/07
1. From JSON API to Swift App
2. Our App’s
3. Swift JSON Parsing & Networking Calls
4. Why I Use Libraries Like Alamofire
5. Hooking Up a REST API to a Table View
6. Custom HTTP Headers
7. Loading UITableViewCell Images from an
8. Pagination, a.k.a., Load More on Scroll
9. Pull to Refresh
10. Authentication: Basic and HTTP Headers
11. Authentication: Implementing the OAuth 2.0 Flow
12. Integrating OAuth with the UI
13. Switching Lists
14. Switching Between View Controllers and More JSON Parsing
15. Adding More API Calls - Starring
16. Deleting Gists
17. Creating Gists and Clearing the Cache
18. What if They’re Offline?
19. What Next?
Appendix: A Brief Introduction to CocoaPods
Christina Moulton has been developing iOS apps for five years and
still randomly types
retain]; once in a while. She
develops custom iPhone and iPad apps at Teak Mobile Inc. in Ontario,
Canada. She writes Swift developer tutorials at
GrokSwift.com as often as she can.