SkeletonView is a Swift UIKit library that shows animated placeholder layouts while views wait on network or long tasks. It helps users see structure before real content arrives.
Overview
Mobile screens often need to mask slow API or processing work. SkeletonView overlays gradient or solid shapes on skeletonable views so lists, labels, and images suggest the upcoming layout instead of blank space or spinners alone.
Developers mark views in code or Interface Builder, then show or hide skeletons on containers; recursion walks subviews until a non-skeletonable view stops the tree. UITableView and UICollectionView integrations use dedicated data-source protocols for headers, footers, and cell identifiers.
Text placeholders draw multiline bars with adjustable line height, spacing, corner radius, and last-line fill percentage. Appearance defaults adapt to light and dark mode, and colors or gradients can be overridden per call.
Built-in pulse and sliding animations cover common cases, with hooks for custom animation closures and cross-dissolve transitions when content loads. Debug helpers and layout update APIs assist when bounds change during rotation or dynamic sizing.
Key features
- Skeletonable UIView marking
- Table and collection view support
- Solid and gradient placeholders
- Pulse and sliding animations
- Multiline text line simulation
- Interface BuilderInspectable corners
- Recursive container display
- Show and hide transitions
Use cases
- Feed loading states
- Profile screen placeholders
- Table view data fetches
- Image-heavy layout previews
- Redacted-style loading UX