Juanpe /SkeletonView

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

★ 12,889⑂ 1,123👁 123⑃ 228● 368▤ 70
SwiftCreated 2017-11-08
12,889
stars
+0+-1+2
1,123
forks
123
watchers
228
prs
368
issues
70
releases
–
discussions

README

!


    
      
    
    
    
    
    
    
       



    Features
  • Guides
  • Installation
  • Usage
  • Miscellaneous
  • Contributing


🌎 README is available in other languages:  🇪🇸 . 🇨🇳 . 🇧🇷 . 🇰🇷 . 🇫🇷 . 🇩🇪

Today almost all apps have async processes, such as API requests, long running processes, etc. While the processes are working, usually developers place a loading view to show users that something is going on.

SkeletonView has been conceived to address this need, an elegant way to show users that something is happening and also prepare them for which contents are waiting.

Enjoy it! 🙂



- 🌟 Features
- 🎬 Guides
- 📲 Installation
- 🐒 Usage
  - 🌿 Collections
  - 🔠 Texts
  - 🦋 Appearance
  - 🎨 Custom colors
  - 🏃‍♀️ Animations
  - 🏄 Transitions
- ✨ Miscellaneous
- ❤️ Contributing
- 📢 Mentions
- 🏆 Sponsors
- 👨🏻‍💻 Author
- 👮🏻 License



 🌟 Features

 Easy to use
 All UIViews are skeletonables
 Fully customizable
 Universal (iPhone & iPad)
 Interface Builder friendly
 Simple Swift syntax
 Lightweight readable codebase


 🎬 Guides

| |||
|:---:  | :---:  | :---: | :---:
|SkeletonView Guides - Getting started|How to Create Loading View with Skeleton View in Swift 5.2    by iKh4ever Studio|Create Skeleton Loading View in App (Swift 5) - Xcode 11, 2020    by iOS Academy| Cómo crear una ANIMACIÓN de CARGA de DATOS en iOS by MoureDev


 📲 Installation

 CocoaPods:

ruby
pod 'SkeletonView'


 Carthage:

ruby
github "Juanpe/SkeletonView"


 Swift Package Manager:

swift
dependencies: [
  .package(url: "https://github.com/Juanpe/SkeletonView.git", from: "1.7.0")
]


 📣 IMPORTANT! 

 Since version 1.30.0, SkeletonView supports XCFrameworks, so if you want to install it as a XCFramework, please use this repo instead.


 🐒 Usage

Only 3 steps needed to use SkeletonView:

1️⃣ Import SkeletonView in proper place.
swift
import SkeletonView


2️⃣ Now, set which views will be skeletonables. You achieve this in two ways:

Using code:
swift
avatarImageView.isSkeletonable = true

Using IB/Storyboards:

!

3️⃣ Once you've set the views, you can show the skeleton. To do so, you have 4 choices:

swift
(1) view.showSkeleton()                 // Solid
(2) view.showGradientSkeleton()         // Gradient
(3) view.showAnimatedSkeleton()         // Solid animated
(4) view.showAnimatedGradientSkeleton() // Gradient animated


Preview




Solid


Gradient


Solid Animated


Gradient Animated



















 📣 IMPORTANT! 

 SkeletonView is recursive, so if you want show the skeleton in all skeletonable views, you only need to call the show method in the main container view. For example, with UIViewControllers.

  


 🌿 Collections

SkeletonView is compatible with UITableView and UICollectionView.


UITableView

If you want to show the skeleton in a UITableView, you need to conform to SkeletonTableViewDataSource protocol.

 swift
public protocol SkeletonTableViewDataSource: UITableViewDataSource {
    func numSections(in collectionSkeletonView: UITableView) - Int // D

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON