gitmyhub

SkeletonView

Swift ★ 13k updated 18d ago

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting

A Swift library for iOS that shows shimmering placeholder animations where content will load, replacing blank screens while your app fetches data.

SwiftUIKitCocoaPodsCarthageSwift Package Managersetup: easycomplexity 2/5

SkeletonView is a Swift library for iOS that shows placeholder loading animations while your app fetches content. You have likely seen this effect in apps like Facebook: instead of a blank screen or a spinning wheel, gray or shimmering shapes appear in the layout to show where text and images will load. SkeletonView provides that effect for any iOS app.

Using the library takes three steps: import it, mark whichever views should participate in the skeleton effect by setting a single property, then call a show method when loading starts. You can choose between four visual styles: solid gray (no animation), solid with a pulsing shimmer animation, gradient (a two-color fade), or gradient with animation. Hiding the skeleton when content arrives is a single call as well.

The library works with the standard iOS list and grid components (UITableView and UICollectionView), and it handles the skeleton display recursively: if you call the show method on a container view, all the marked child views inside it pick up the skeleton automatically without each one needing a separate call.

Colors, gradients, corner radius, and animation speed can all be customized. The library also works with Interface Builder and Storyboards, so designers can mark views as skeletonable visually without writing code. It runs on both iPhone and iPad.

SkeletonView can be installed via CocoaPods, Carthage, or Swift Package Manager. The project is open source and available in multiple translated READMEs for Spanish, Chinese, Portuguese, Korean, French, and German audiences.

Where it fits