All bites
The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.
8667 bites
Page 315

StoreKit
StoreKit is Apple's framework for in-app purchases and subscriptions. It manages product lookup, presenting the payment sheet, processing transactions, and restoring purchases, so apps never touch raw payment data directly.

Vision Framework: Computer Vision on Apple Devices
The Vision framework is your on-device toolkit for understanding images and video. Use it for face detection, text recognition, or barcode scanning without needing ML expertise. Footgun: don't run requests on every frame; it drains the battery.

Core ML: On-Device Machine Learning for Apple Apps
Core ML runs pre-trained machine learning models directly on Apple devices, enabling fast, private, and offline AI. It's used for features like real-time image recognition or text analysis. The footgun: Core ML only runs models; it doesn't train them.

AVFoundation: Apple's Toolkit for Audio and Video
AVFoundation is Apple's low-level toolbox for audio and video. Use it for custom camera UIs, video editing, or complex audio playback. The main footgun is its complexity; managing sessions, inputs, and outputs on the correct threads is notoriously difficult.

MapKit: Putting Apple Maps in Your iOS App
MapKit is the toolkit for embedding Apple's interactive maps directly into your app. Use it to show user location, display points of interest, or provide directions. The footgun is rendering too many pins at once; use clustering to keep the UI responsive.

Core Location: Your App's Sense of Place
Core Location gives your app its sense of place, from a precise coordinate to a general region. It powers maps, ride-sharing, and location-based reminders. Use it for one-time fixes, continuous tracking, or geofencing.

CAReplicatorLayer: A 'For Loop' for Layers
CAReplicatorLayer is a 'for loop' for layers, creating complex patterns from a single source layer. Use it for loading spinners or radial bursts. The footgun: transformations are cumulative, so each copy is transformed relative to the previous one, not the…

GeometryEffect
GeometryEffect is a SwiftUI protocol for building custom animatable 2D transforms beyond the built-in offset, scaleEffect, and rotationEffect modifiers, by returning a ProjectionTransform that SwiftUI recomputes and animates on every frame.

The Animatable Protocol
The Animatable protocol lets a custom SwiftUI view or Shape expose its state as interpolatable data, so SwiftUI can smoothly tween between values across frames instead of snapping, which is how custom shapes and progress indicators get real animation.

CATransaction: Grouping Core Animation Changes
Think of CATransaction as an atomic 'commit' for UI animations, grouping layer property changes to appear at once. Use it to synchronize animations or set a custom duration for a batch of changes.

CAKeyframeAnimation: Animating Through Key States
CAKeyframeAnimation defines animations with waypoints, not just a start and end. Think of it as a flipbook where you set key frames and the system interpolates. Use it for complex paths, like shaking an icon. Footgun: setting both path and values.

Canvas in SwiftUI
Canvas is SwiftUI's view for fast, immediate mode drawing. Instead of composing many shape views, you draw paths, text, and images directly into a GraphicsContext, which is far cheaper for complex or animated graphics.

Creating Custom Gestures by Subclassing UIGestureRecognizer
Subclassing UIGestureRecognizer lets you build a custom state machine for touch events. Use it for unique interactions like a rotary dial. The footgun is state management: you must explicitly update the gesture's state or it will never be recognized.

CAShapeLayer: Hardware-Accelerated Vector Drawing
A CAShapeLayer is a GPU-powered stencil for drawing vector shapes. It renders paths like lines and curves far more efficiently than drawing in draw(_:). Use it for custom UI like progress rings.

CABasicAnimation: Simple Property Changes Over Time
CABasicAnimation animates a single layer property from a start to an end value. Use it for fading a view (opacity), moving it (position), or scaling it (transform).

UIBezierPath: Drawing Custom Shapes in Code
UIBezierPath is a digital pen for drawing custom shapes. You define a path with lines and curves, then fill or stroke it. It's essential for custom charts, icons, or non-rectangular views.

CALayer
CALayer is the Core Animation object that actually draws and animates a UIView's content on screen, while the view itself handles touch input, layout, and event routing on top of it.

TaskGroup: Dynamic, Structured Concurrency in Swift
A TaskGroup is like a manager for parallel jobs. You add a dynamic number of tasks, and it runs them concurrently, ensuring the parent task waits for them all. Use it to fetch multiple images or API data.

URLSessionDownloadTask: Download Files Without Hogging Memory
URLSessionDownloadTask downloads files directly to disk, not memory, making it ideal for large assets. Use it for videos or updates, especially in the background. The footgun: you must move the file from its temporary location or the OS will delete it.

AsyncSequence: A Sequence That Awaits Its Next Element
AsyncSequence is like a regular Swift Sequence, but you await its next element. It lets you process values that arrive over time, like network data, without blocking. The footgun: iteration suspends, so run it in a Task for true concurrency.