Book Image

Swift Cookbook

By : Cecil Costa, Cecil Costa
Book Image

Swift Cookbook

By: Cecil Costa, Cecil Costa

Overview of this book

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

Controlling your stock


The idea of an application connected with a database came with the need of keeping some data even if the application finishes. However, SQL is another language, and you have to repeat the development twice, similar to how a new field in a class is also a new field in the database.

When Xerox developed the first window system based on Smalltalk, they didn't use any kind of database. The argument for this was that if an application doesn't finish, the data will always be stored in the RAM memory.

The idea itself is very intelligent, but we know that the real world doesn't work like that. Applications crash and finish and devices need to reboot sometimes. Besides this, you also need to consider that up to the present the RAM memory is still more expensive than hard disks. The new iPhone 6, for example, has only 1 gigabyte of RAM and at least 32 gigabytes of permanent storage.

Based on the problems mentioned earlier, Apple recommends that you use its own ORM called Core Data...