Book Image

Swift Cookbook

Book Image

Swift Cookbook

Overview of this book

Table of Contents (18 chapters)
Swift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


As you may know, nowadays it is very difficult to imagine an app that doesn't store anything on the hard disk. Simple apps, such as a calculator or a compass might not need to store any information, but you will usually need to create apps with more complex features to keep the information even if the device reboots.

When you have to store a minimum amount of information, such as a simple date or just the current app version, you can use a file as we have done in the previous chapters of this book, but when you have to store a few records with different data structures, you need the help of a database.

In this chapter, we are going to learn how to use databases on Swift, and you will see the advantages of each method.