Modern platform cheat sheet
The 9 Modern platform interview answers in 30 seconds each, plus quick facts. Printable, free.
One page per topic: print it or save it as PDF from your browser's print menu. Practise these questions
Building widgets with WidgetKit
A widget is a SwiftUI view rendered from a timeline of entries that your TimelineProvider supplies; the system shows each entry at its date, so the widget doesn't run code continuously. Share data with the app through an App Group, call WidgetCenter.shared.reloadTimelines(ofKind:) when the data changes, and choose a reload policy. Since iOS 17, widgets can be interactive with Button(intent:) and Toggle(intent:).
App Intents and Shortcuts
An App Intent is a Swift type describing an action your app can perform, with a title, parameters and a perform() method. The system uses it for Shortcuts, Siri, Spotlight, widgets, controls and the Action button. Add an AppShortcutsProvider with phrases so the action works without any setup by the user, and use AppEntity for your app's objects.
Live Activities
A Live Activity shows live status on the Lock Screen and Dynamic Island. Define ActivityAttributes with a ContentState, start it with Activity.request(attributes:content:pushType: .token), and send its push token to your server. The server updates it with APNs pushes of type liveactivity carrying the new content state, and ends it with a dismissal policy. Updates are limited, so send only meaningful changes.
In-app purchases with StoreKit 2
Load products with Product.products(for:), call product.purchase(), and check the VerificationResult: only unlock for .verified transactions, then call transaction.finish(). Listen to Transaction.updates from launch to catch renewals, purchases on other devices and Ask to Buy approvals, and compute access from Transaction.currentEntitlements. SwiftUI's StoreView and SubscriptionStoreView give ready-made store UI.
Keeping subscription access correct everywhere
Treat the App Store as the source of truth. On each device, derive access from Transaction.currentEntitlements at launch and update it from Transaction.updates. If users also sign in to your service, set appAccountToken at purchase and keep a server-side record updated by App Store Server Notifications V2, so web and other platforms agree. Handle grace periods, billing retry, refunds and family sharing.
Privacy manifests
A privacy manifest (PrivacyInfo.xcprivacy) declares what data your app or SDK collects and why, whether it tracks and which tracking domains it uses, and the approved reasons for using required-reason APIs such as UserDefaults, file timestamps, system boot time and disk space. App Store Connect checks it and reports missing declarations, and third-party SDKs must include their own.
Adopting Liquid Glass in iOS 26
Liquid Glass is the iOS 26 design material for controls and navigation: translucent, refractive and floating above content. Standard components such as tab bars, toolbars, navigation bars and sheets adopt it automatically when you build with the iOS 26 SDK. For custom controls, use .glassEffect() in SwiftUI (grouped in a GlassEffectContainer) or UIGlassEffect in UIKit, keep glass on the controls layer rather than the content, and remove custom bar backgrounds that fight it.
SwiftUI previews with #Preview and @Previewable
Use the #Preview macro to declare previews, with names and traits such as .sizeThatFitsLayout or a landscape orientation. Mark state with @Previewable to declare it right inside the preview and pass bindings. Feed previews with injected mock data or an in-memory model container, so they're fast and never touch the network.
On-device models with Foundation Models
The Foundation Models framework (iOS 26) gives access to the on-device model behind Apple Intelligence. Check SystemLanguageModel.default.availability first, because the device may not support it or the feature may be off. Create a LanguageModelSession with instructions, call respond(to:), or stream responses, and use @Generable types for structured output and tools for calling your own code.
import FoundationModels
@Generable
struct NoteSummary {
@Guide(description: "One-sentence summary")
var headline: String
var actionItems: [String]
}
func summarize(_ text: String) async throws -> NoteSummary? {
guard case .available = SystemLanguageModel.default.availability else { return nil }
let session = LanguageModelSession(instructions: "Summarise notes briefly.")
return try await session.respond(to: text, generating: NoteSummary.self).content
}Quick facts
- Control Center controls
- iOS 18 lets apps add controls to Control Center, the Lock Screen and the Action button using ControlWidget and App Intents.
- Push-to-start
- From iOS 17.2, a server can start a Live Activity with a push-to-start token.
- StoreKit testing
- A StoreKit configuration file lets you test purchases locally in Xcode without App Store Connect.