Core OS and Core Services
When TrailLog saves a hike, many things happen that you never write: a file is created on flash storage, it is encrypted, a GPS chip reports your position, a network socket uploads a backup. iOS organises all of that into layers, and knowing them tells you where to look for any capability.
The rule
Four layers, top to bottom: Cocoa Touch, Media, Core Services, Core OS.
Each layer builds on the ones beneath it. Your app mostly talks to the top, and the lower layers do the heavy lifting underneath.
| Layer | What lives there | Examples |
|---|---|---|
| Cocoa Touch | Screens, touches, app lifecycle | UIKit, SwiftUI, notifications |
| Media | Drawing, animation, images, sound, video | Core Graphics, Core Animation, AVFoundation, Metal |
| Core Services | Data, networking, location, system services | Foundation, Core Data, Core Location, CloudKit |
| Core OS | Kernel, hardware access, security | Darwin kernel, file system, drivers, keychain services |
This lesson covers the two bottom layers.
Core OS is the foundation shared with macOS: the Darwin kernel, memory and process management, the file system, low-level networking, drivers for hardware, and the security machinery (sandboxing, encryption, the Keychain). Apps rarely call it directly; it is what every higher framework ultimately stands on.
Core Services gives you the everyday building blocks that are not about the screen:
- Foundation — strings, dates, numbers, collections,
URLSessionfor networking,FileManager,JSONEncoder. - Core Data and SwiftData — storing object graphs on the device.
- Core Location — the user's position.
- CloudKit — syncing data through iCloud.
import Foundation
import CoreLocation
let saved = Date() // Foundation
let manager = CLLocationManager() // Core Location