© Bruce Wade 2016

Bruce Wade, OS X App Development with CloudKit and Swift, 10.1007/978-1-4842-1880-8_1

1. Introduction

Bruce Wade

(1)Suite No. 1408, North Vancouver, British Columbia, Canada

Electronic supplementary material

The online version of this chapter (doi:10.​1007/​978-1-4842-1880-8_​1) contains supplementary material, which is available to authorized users.

We are living in an exciting time in which data-driven applications (DDAs) are becoming an indispensable way of life. Unfortunately, creating a data-driven application isn’t always the most straightforward process. When developing DDAs we have to worry about network connectivity, web services, scalability, security, app authentication, performance, and how to handle data synchronization between apps and devices. If this feels like a huge undertaking, you are not alone.

With the release of Apple’s CloudKit , most of these concerns have been eliminated to the point where we don’t even have to think or know about them. There is no longer a need for a user to enter a username and password (as long as they are logged into iCloud) and Apple handles all scalability issues; there is also no need to write custom web services (this unfortunately has its own limitations). There are a few remaining areas to deal with, including performance, data synchronization, and network connectivity.

Apple has also supplied a web-based dashboard interface , which provides a way to manage an application’s data and enables the user to get started as fast as possible. As you will learn in a later chapter, this dashboard makes it extremely simple to manage and monitor your data.

With CloudKit’s very generous usage limits there is no better time than now to start building data-driven applications.

Goals of This book

In this book we are going to work through creating a dog parks OS X application using Swift and CloudKit. Before we jump into coding we will create a basic prototype of our application, to which we will gradually add more functionality until we have a completely functional data-driven application.

Assumptions about the Reader

To get the most out of this book it is recommended and assumed that you have at least gone through the Swift Programming Language book for Swift version 2 provided by Apple. If you have no background knowledge of the Swift programming language you may struggle with some parts of this book.

A fundamental knowledge of OS X development is required, as this book will not be walking you through the basics. If you are new to OS X development you might want to check out Swift OS X Programming for Absolute Beginners from Apress.

Finally, you are expected to know how to navigate around OS X, especially the App Store and Safari.

Software Requirements

Over the course of this book we will be using Sketch 3 (free trial or full version), Keynote, Xcode, and the CloudKit dashboard. In this section we will cover downloading the required software.

Downloading Sketch 3

Sketch 3 is becoming a very popular application for UI design; it can be used for designing mobile, web, and desktop applications. There are a lot of talented designers moving away from Adobe Photoshop and focusing primarily on Sketch 3. The beauty of Sketch 3 is how easy it is to use for designers and developers alike.

We can download Sketch 3 directly from Bohemian Coding. You can either download a trial version or pay for the full version. If you want to save your files to iCloud, make sure you first have iCloud Drive enabled.

1. Open Safari and navigate to https://www.sketchapp.com .

2. When the page loads you will be presented with two options:

a. Free Trial

b. Buy

3. If you want to just try Sketch 3 (all that is needed for this book), select the “Trial” option. Otherwise, click on “Buy” for an unlimited version.

We will cover the basics of using Sketch 3 later. Also, I will provide a resource for free online videos that will teach you more on how to use Sketch 3.

Downloading and Installing Keynote

If you purchased your Mac computer in the last few years you should have Keynote installed already. If not, you will have to purchase it from the OS X App Store if you wish to follow along with the Keynote portion of this book.

1. Click on the OS X App Store Icon in the Dock A385012_1_En_1_Figa_HTML.jpg .

2. Search for “Keynote.”

A385012_1_En_1_Figb_HTML.jpg

3. When the search results have loaded, select the Keynote icon to learn more.

A385012_1_En_1_Figc_HTML.jpg

4. Select the option to Buy/Install. Mine shows OPEN, as I have already installed Keynote.

Downloading and Installing Xcode

While Xcode is going to be our most heavily used tool, it is important to resist the urge to jump in and start coding. Diving in is acceptable when you are writing code for testing purposes or trying something from a tutorial you saw online or in a book. However, when you are making a real project you need to start with a prototype, a step that Apple has been emphasizing over the last few years at their development conferences.

Prototyping: Faking It Till You Make It - https://developer.apple.com/videos/play/wwdc2014-223/

Designing for the Future Hardware - https://developer.apple.com/videos/play/wwdc2015-801/

To download Xcode from the OS X App Store, do the following:

1. Click on the OS X App Store Icon in the Dock A385012_1_En_1_Figd_HTML.jpg.

2. Search for “Xcode.”

A385012_1_En_1_Fige_HTML.jpg

3. When the search results have loaded, select the Xcode icon.

A385012_1_En_1_Figf_HTML.jpg

4. Read the description and click the Install button. My screen shows OPEN because I already have Xcode installed.

About the App We Are Going to Be Creating

There are an impressive number of dog lovers in the world, and you might be one of them. Some places, especially where I live, have rules about where dogs are or are not allowed, and also where dogs are allowed off the leash. We are going to focus on the OS X version of this application; motivated readers can also create iOS and web versions using CloudKit, synchronizing the data between them.

The primary features we are going to be focusing on are:

a. Searching for dog-friendly parks (we will be focusing on North Vancouver, Canada)

b. Finding specifically off-leash areas for your dog to run around free

c. Finding specifically leash-required areas for dogs that are not comfortable off leash

d. Adding new parks that other users of the app can see

e. Approving/verifying user-created parks

f. Uploading photos of your experiences at a specific park

g. Viewing/creating reviews for dog parks

h. Viewing/adding warnings; for example, bear in the area, aggressive dog, etc.

Conclusion

This chapter provided an overview of what we will be creating over the course of this book, along with what is expected of you, the reader. In the next chapter we will dive into the planning of our app, get an overview of Sketch 3, and use Keynote for some basic animations of our app’s user interface before moving onto coding.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset