![](../Assets/header2.jpg)
**๐ ๋ฒ์ญ์ ๋์์ ์ฃผ์ ๋ถ๋ค: [๐ฌ๐ง](../README.md) . [๐จ๐ณ](README_zh.md) . [๐ง๐ท](README_pt-br.md) . [๐ฐ๐ท](README_ko.md) . [๐ซ๐ท](README_fr.md) . [๐ฉ๐ช](README_de.md)**
์ค๋๋ ๊ฑฐ์ ๋๋ถ๋ถ์ ์ฑ๋ค์ ๋น๋๊ธฐ ๋ฐฉ์์ API ํธ์ถ์ ์ฌ์ฉํ๋ ํ๋ก์ธ์ค๋ฅผ ๊ฐ์ง๊ณ ์์ต๋๋ค.
ํ๋ก์ธ์ค๊ฐ ์๋ํ๋๋์ ๊ฐ๋ฐ์๋ค์ ์์
์ด ์คํ๋๊ณ ์๋ค๋๊ฒ์ ์ฌ์ฉ์๋ค์๊ฒ ๋ณด์ฌ์ฃผ๊ธฐ ์ํด์ ๋ก๋ฉ ๋ทฐ๋ฅผ ๋ฐฐ์นํฉ๋๋ค.
```SkeletonView```๋ ์ด๋ฌํ ํ์์ ์ํด ๊ณ ์๋์๊ณ , ์ฌ์ฉ์๋ค์๊ฒ ๋ฌด์์ธ๊ฐ ๋ก๋ฉ์ด ๋๊ณ ์๋ค๋๊ฒ์ ๋ณด์ฌ์ฃผ๋ฉด์ ๊ธฐ๋ค๋ฆฌ๋ ์ฝํ
์ธ ์ ๋ํด์๋ ๋ฏธ๋ฆฌ ์ค๋นํ ์ ์๊ฒ ํด์ฃผ๋ ์ฐ์ํ๊ฒ ํํํ ์ ์๋ ๋ฐฉ๋ฒ์
๋๋ค
๋ง๊ป ๋๋ฆฌ์ธ์ ๐
* [๊ธฐ๋ฅ](#-features)
* [๊ฐ์ด๋](#-guides)
* [์ค์น๋ฐฉ๋ฒ](#-installation)
* [Cocoapods](#using-cocoapods)
* [Carthage](#using-carthage)
* [SPM](#using-swift-package-manager)
* [์ด๋ป๊ฒ ์ฌ์ฉํ๋์?](#-how-to-use)
* [Collections](#-collections)
* [Multiline text](#-multiline-text)
* [Custom colors](#-custom-colors)
* [Appearance](#-appearance)
* [Custom animations](#-custom-animations)
* [Hierarchy](#-hierarchy)
* [Debug](#-debug)
* [๋ฌธ์ํ](#-documentation)
* [์ง์๋๋ OS์ SDK ๋ฒ์ ](#-supported-os--sdk-versions)
* [Next steps](#-next-steps)
* [Contributing](#-contributing)
* [Mentions](#-mentions)
* [๊ฐ๋ฐ์](#-author)
* [๋ผ์ด์ผ์ค](#-license)
## ๐ ๊ธฐ๋ฅ
- [x] ์ฌ์ฉ์ด ์ฝ์ต๋๋ค
- [x] ๋ชจ๋ `UIView`์์ ์ฌ์ฉ๊ฐ๋ฅํฉ๋๋ค
- [x] ์ ์ฒด ์ปค์คํฐ๋ง์ด์ง์ด ๊ฐ๋ฅํฉ๋๋ค
- [x] ๊ณตํต์ผ๋ก ์ด์ฉ๊ฐ๋ฅํฉ๋๋ค (iPhone & iPad)
- [x] `Interface Builder` ์์ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค.
- [x] ๊ฐ๋จํ ์ค์ํํธ ๋ฌธ๋ฒ
- [x] ๊ฐ๋ณ๊ณ ๊ฐ๋
์ฑ ์ข์ ์ฝ๋
## ๐ฌ ์ฌ์ฉ๊ฐ์ด๋
[](https://youtu.be/75kgOhWsPNA)
## ๐ฒ ์ค์น ๋ฐฉ๋ฒ
#### [CocoaPods](https://cocoapods.org) ๋ก ์ฌ์ฉํ๊ธฐ
๋น์ ์ ํ๋ก์ ํธ `Podfile` ํ์ผ์ ์๋์ ๊ฐ์ด ์
๋ ฅํฉ๋๋ค:
```ruby
pod "SkeletonView"
```
#### [Carthage](https://github.com/carthage)๋ก ์ฌ์ฉํ๊ธฐ
๋น์ ์ ํ๋ก์ ํธ `Cartfile` ํ์ผ์ ์๋์ ๊ฐ์ด ์
๋ ฅํฉ๋๋ค:
```bash
github "Juanpe/SkeletonView"
```
#### [Swift Package Manager](https://github.com/apple/swift-package-manager)๋ก ์ฌ์ฉํ๊ธฐ
๋น์ ์ ํ๋ก์ ํธ์ Swift package๋ฅผ ์ค์ ํ๋ค๋ฉด, `SkeletonView` ๋ฅผ `Package.swift` ํ์ผ์ ์๋ `dependencies`์ ์ถ๊ฐํ์๋ฉด ๋ฉ๋๋ค.
```swift
dependencies: [
.package(url: "https://github.com/Juanpe/SkeletonView.git", from: "1.6")
]
```
## ๐ ์ด๋ป๊ฒ ์ฌ์ฉํ๋์?
`SkeletonView` ๋ฅผ ์ด์ฉํ๊ธฐ ์ํด์๋ ๋ฑ **3** ๋จ๊ณ๋ง ๊ธฐ์ตํ์ธ์:
**1.** ์ฌ์ฉํ๊ณ ์ ํ๋ ํ์ผ์์ `SkeletonView` ๋ฅผ `Import` ํฉ๋๋ค.
```swift
import SkeletonView
```
**2.** ์, ๊ทธ๋ ๋ค๋ฉด UIView ์์ฑ์ `skeletonables` ๋ฅผ ์ด์ฉํ์ค ์ ์์ต๋๋ค. ๋๊ฐ์ง ์ต์
์ด ์์ต๋๋ค
**์ฝ๋๋ก ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ:**
```swift
avatarImageView.isSkeletonable = true
```
**์ธํฐํ์ด์ค๋น๋ / ์คํ ๋ฆฌ๋ณด๋๋ฅผ ์ด์ฉํ๋ ๋ฐฉ๋ฒ:**
![](../Assets/storyboard.png)
**3.** ๋น์ ์ด ๋ทฐ๋ฅผ ์ธํ
ํ ๋, **skeleton** ์ต์
์ ์ฌ์ฉ ํ ์ ์์ต๋๋ค. ์ด **4** ๊ฐ์ง ์ต์
์ ์ง์ํฉ๋๋ค:
```swift
(1) view.showSkeleton() // Solid
(2) view.showGradientSkeleton() // Gradient
(3) view.showAnimatedSkeleton() // Solid animated
(4) view.showAnimatedGradientSkeleton() // Gradient animated
```
**๋ฏธ๋ฆฌ๋ณด๊ธฐ**
Solid
|
Gradient
|
Solid Animated
|
Gradient Animated
|
|
|
|
|
> **์ค์!**
>>```SkeletonView``` ๋ ์ฌ๊ท์ ์ผ๋ก ๋์ด์์ต๋๋ค, ๋ง์ฝ ๋ชจ๋ ๋ทฐ์ ๋ํด์ skeleton์ ํธ์ถํ๊ณ ์ถ๋ค๋ฉด, ๋ฉ์ธ ์ปจํ
์ด๋ ๋ทฐ์์ show `method`๋ฅผ ํธ์ถํ์ฌ์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์๋ฉด UIViewControllers๊ฐ ์์ต๋๋ค.
### ๐ฟ Collections
ํ์ฌ, ```SkeletonView``` ๋ ```UITableView``` ์ ```UICollectionView```์์ ํธํ๋ฉ๋๋ค.
#### UITableView
๋ง์ฝ ```UITableView```์์ skeleton์ ํธ์ถํ๊ณ ์ถ๋ค๋ฉด, ```SkeletonTableViewDataSource``` protocol ์ ๊ตฌํํ์ฌ์ผ ํฉ๋๋ค.
``` swift
public protocol SkeletonTableViewDataSource: UITableViewDataSource {
func numSections(in collectionSkeletonView: UITableView) -> Int
func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int
func collectionSkeletonView(_ skeletonView: UITableView, cellIdentifierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier
}
```
ํด๋น ํ๋กํ ํด์ ๋ณด์๋ค์ํผ ```UITableViewDataSource```๋ฅผ ์์๋ฐ์ ๊ตฌํํ์์ผ๋ฏ๋ก, skeleton์ protocol๊ณผ ๋์ฒด ๊ฐ๋ฅํฉ๋๋ค.
ํ๋กํ ์ฝ์ ๊ธฐ๋ณธ ๊ตฌํ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
``` swift
func numSections(in collectionSkeletonView: UITableView) -> Int
// Default: 1
```
``` swift
func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int
// Default:
// ์ ์ฒด ํ
์ด๋ธ ๋ทฐ๋ฅผ ์ฑ์ฐ๋๋ฐ ํ์ํ ์
์๋ฅผ ๊ณ์ฐํฉ๋๋ค
```
ํด๋น ๋ฉ์๋๋ ๋น์ ์ด ๊ตฌํํ์ฌ์ผํ cell identifier์ ์๋ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํฉ๋๋ค, ํด๋น ๋ฉ์๋๋ ๊ธฐ๋ณธ์ผ๋ก ๊ตฌํํ์ง ์์๋๋ฉ๋๋ค :
``` swift
func collectionSkeletonView(_ skeletonView: UITableView, cellIdentifierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier
```
**Example**
``` swift
func collectionSkeletonView(_ skeletonView: UITableView, cellIdentifierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier {
return "CellIdentifier"
}
```
> **์ค์!**
> ๋ง์ฝ ์ฌ์ด์ฆ๊ฐ ๋ณํ๋ ์
์ ์ฌ์ฉํ๋ค๋ฉด (`tableView.rowHeight = UITableViewAutomaticDimension` ),`estimatedRowHeight`๋ฅผ ๋ฌด์กฐ๊ฑด ์ ์ํด์ฃผ์ธ์.
๐ฉ๐ผโ๐ซ **์ด๋ป๊ฒ ํน์ ์์์ skeleton ์ ์ง์ ํ ๊น์?**
์๋์ ๊ทธ๋ฆผ์ `UITableView` ์์ ํน์ ํ ์์์ skeleton ์ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ฃผ๋ ์ด๋ฏธ์ง ์
๋๋ค:
![](../Assets/tableview_scheme.png)
์์ ์ด๋ฏธ์ง์์ ๋ณด์ด๋ฏ, ํ
์ด๋ธ ๋ทฐ์ ์
์ ๋ค์ด๊ฐ๋ UI ์์๋ค์๋ ์ ์ฉ์ ํด์ผํ์ง๋ง, `contentView`์ skeleton์ ์ ์ฉํ ํ์๋ ์์ต๋๋ค.
#### UICollectionView
```UICollectionView``` ์ ์ ์ฉ์ ํ๊ธฐ ์ํด์๋, ```SkeletonCollectionViewDataSource``` protocol ์ ๊ตฌํํ ํ์๊ฐ ์์ต๋๋ค.
``` swift
public protocol SkeletonCollectionViewDataSource: UICollectionViewDataSource {
func numSections(in collectionSkeletonView: UICollectionView) -> Int
func collectionSkeletonView(_ skeletonView: UICollectionView, numberOfItemsInSection section: Int) -> Int
func collectionSkeletonView(_ skeletonView: UICollectionView, cellIdentifierForItemAt indexPath: IndexPath) -> ReusableCellIdentifier
}
```
```UITableView``` ์ ์ฌ์ฉ๋ฐฉ๋ฒ์ ๊ฐ์ต๋๋ค.
### ๐ฐ Multiline text
![](../Assets/multilines2.png)
ํ
์คํธ๊ฐ ๋ค์ด์๋ ์์๋ฅผ ์ฌ์ฉํ๋ค๋ฉด, ```SkeletonView``` ์์ ํ
์คํธ์ ๋ผ์ธ์ ๊ทธ๋ ค์ค๋๋ค.
๊ทธ๋ฆฌ๊ณ , ์ํ๋ ๋ผ์ธ ์๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. ๋ง์ฝ ```numberOfLines``` ์ 0์ผ๋ก ์ค์ ํ๋ค๋ฉด, ์๋์ผ๋ก ํ์ํ ๋ผ์ธ์๋ฅผ ๊ณ์ฐํด์ ๊ทธ๋ ค์ค๋๋ค. ๋์ ๊ฐ์ด ์ค์ ๋์ด์๋ค๋ฉด ์ค์ ๋ ์๋งํผ์ ๋ผ์ธ์ด ๊ทธ๋ ค์ง๋๋ค.
##### ๐ Customize
๋น์ ์ ๋ฉํฐ๋ผ์ธ์ ์ํด ๋ช๊ฐ์ง ์ต์
์ ์ค์ ํ ์ ์์ต๋๋ค.
| ์์ฑ | ๊ฐ | ๊ธฐ๋ณธ๊ฐ | ๋ฏธ๋ฆฌ๋ณด๊ธฐ |
| ----------------------------------------------- | --------- | ----- | ---------------------------------- |
| ๋ง์ง๋ง ๋ผ์ธ์ **ํผ์ผํธ** ๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. | `0...100` | `70%` | ![](../Assets/multiline_lastline.png) |
| ๋ผ์ธ์ **Corner radius** ๋ฅผ ์ง์ ํ ์ ์์ต๋๋ค. (**์๋ก์ด๊ธฐ๋ฅ**) | `0...10` | `0` | ![](../Assets/multiline_corner.png) |
๋ผ์ธ์ radius๋ฅผ ์ง์ ํ๊ธฐ ์ํด์๋ **์ฝ๋** ๋ฅผ ์ด์ฉํฉ๋๋ค, ์๋ ์ฒ๋ผ ์ฝ๋๋ฅผ ์์ฑํฉ๋๋ค:
```swift
descriptionTextView.lastLineFillPercent = 50
descriptionTextView.linesCornerRadius = 5
```
ํน์ **IB/Storyboard** ๋ฅผ ์ด์ฉํ์ค ์ ์์ต๋๋ค:
![](../Assets/multiline_customize.png)
### ๐จ Custom colors
๋น์ ์ skeleton์ ์์์ ์ง์ ํ ์ ์์ต๋๋ค. ๊ฐ๋จํ๊ฒ ์ํ๋ ์์์ ํ๋ผ๋ฏธํฐ๋ก ๋๊ฒจ์ฃผ์๋ฉด ๋ฉ๋๋ค.
**๋จ์ ์ด์ฉ๋ฐฉ๋ฒ**
``` swift
view.showSkeleton(usingColor: UIColor.gray) // Solid
// or
view.showSkeleton(usingColor: UIColor(red: 25.0, green: 30.0, blue: 255.0, alpha: 1.0))
```
**๊ทธ๋ผ๋์ธํธ ์ด์ฉ ๋ฐฉ๋ฒ**
``` swift
let gradient = SkeletonGradient(baseColor: UIColor.midnightBlue)
view.showGradientSkeleton(usingGradient: gradient) // Gradient
```
๊ฒ๋ค๊ฐ, ```SkeletonView``` ์์๋ 20๊ฐ์ง์ ๊ธฐ๋ณธ ์ปฌ๋ฌ๋ฅผ ์ง์ํฉ๋๋ค ๐ค๐ผ
```UIColor.turquoise, UIColor.greenSea, UIColor.sunFlower, UIColor.flatOrange ...```
![](../Assets/flatcolors.png)
###### ์ ์ด๋ฏธ์ง๋ [https://flatuicolors.com](https://flatuicolors.com) ์ฌ์ดํธ์์ ๋ฐ์ทํ์ต๋๋ค.
### ๐ฆ Appearance
**์๋ก์ด ์ฌํญ** skeleton ์ ๊ธฐ๋ณธ์ค์ ๊ฐ์ด ์ ํด์ ธ ์์ต๋๋ค. ๋ง์ฝ ์ปค์คํ
์ปฌ๋ฌ๋ฅผ ์ฌ์ฉํ ํ์๊ฐ ์๋ค๋ฉด, `SkeletonView` ์ ์ง์ ๋์ด์๋ ๊ธฐ๋ณธ์ค์ ์ ์ฌ์ฉํ์๋ฉด ๋ฉ๋๋ค.
๊ธฐ๋ณธ ์ค์ ๊ฐ:
- **tintColor**: UIColor
- *๊ธฐ๋ณธ๊ฐ: .clouds*
- **gradient**: SkeletonGradient
- *๊ธฐ๋ณธ๊ฐ: SkeletonGradient(baseColor: .clouds)*
- **multilineHeight**: CGFloat
- *๊ธฐ๋ณธ๊ฐ: 15*
- **multilineSpacing**: CGFloat
- *๊ธฐ๋ณธ๊ฐ: 10*
- **multilineLastLineFillPercent**: Int
- *๊ธฐ๋ณธ๊ฐ: 70*
- **multilineCornerRadius**: Int
- *๊ธฐ๋ณธ๊ฐ: 0*
`SkeletonAppearance.default` ์๋ ์ฌ์ฉ ๋์ด์ง๋ ๊ธฐ๋ณธ ๊ฐ๋ค์ด ์ค์ ๋์ด ์์ต๋๋ค . ์๋์ ์ฝ๋์ ๊ฐ์ด ์ฌ์ฉํ ์ ์์ต๋๋ค:
```Swift
SkeletonAppearance.default.multilineHeight = 20
SkeletonAppearance.default.tintColor = .green
```
### ๐ค ์ปค์คํ
์ ๋๋ฉ์ด์
```SkeletonView``` ์๋ ๋๊ฐ์ง ์ ๋๋ฉ์ด์
์ด ๋ด์ฅ๋์ด ์์ต๋๋ค, ๋จ์ *๋ฐ์ด์ค* ์ ๋๋ฉ์ด์
๊ณผ ๊ทธ๋ผ๋์ธํธ *์ฌ๋ผ์ด๋* ์ ๋๋ฉ์ด์
์
๋๋ค .
๊ฒ๋ค๊ฐ, ์ง์ ์ ๋๋ฉ์ด์
์ ์ถ๊ฐํ๊ณ ์ถ๋ค๋ฉด ์ ๋ง ๊ฐ๋จํฉ๋๋ค.
Skeleton ์์๋ `showAnimatedSkeleton` ํจ์๋ฅผ ```SkeletonLayerAnimation```์ ์ ์ํ์ฌ ๋ง์ถคํ ์ ๋๋ฉ์ด์
์ ์ ์ํ ์ ์๋๋ก ๋์ด ์์ต๋๋ค.
```swift
public typealias SkeletonLayerAnimation = (CALayer) -> CAAnimation
```
ํจ์๋ ์ด๋ ๊ฒ ํธ์ถ ๊ฐ๋ฅํฉ๋๋ค:
```swift
view.showAnimatedSkeleton { (layer) -> CAAnimation in
let animation = CAAnimation()
// Customize here your animation
return animation
}
```
```SkeletonAnimationBuilder```์ ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค. ```SkeletonLayerAnimation```์ ๋ง๋ค๊ธฐ ์ํด ์ฌ์ฉ๋ฉ๋๋ค.
์ด์ , ๊ทธ๋ผ๋์ธํธ๋ฅผ ์ํ **์ฌ๋ผ์ด๋ฉ ์ ๋๋ฉ์ด์
** ์ ๋ง๋ค ์ ์์ต๋๋ค, ์ ๋๋ฉ์ด์
์ ์ํ **๋ฐฉํฅ** ๊ณผ **์ง์์๊ฐ** ์ ์ค์ ํ ์ ์์ต๋๋ค. (๊ธฐ๋ณธ๊ฐ = 1.5์ด).
```swift
// func makeSlidingAnimation(withDirection direction: GradientDirection, duration: CFTimeInterval = 1.5) -> SkeletonLayerAnimation
let animation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .leftToRight)
view.showAnimatedGradientSkeleton(usingGradient: gradient, animation: animation)
```
```GradientDirection``` ๋ enum ์ผ๋ก ์ ์ ๋์ด์์ต๋๋ค., ์๋์ ์ผ์ด์ค๋ฅผ ์ฐธ์กฐํ์ธ์:
| ๋ฐฉํฅ | ๋ฏธ๋ฆฌ๋ณด๊ธฐ |
| ------------------- | ---------------------------------------------- |
| .leftRight | ![](../Assets/sliding_left_to_right.gif) |
| .rightLeft | ![](../Assets/sliding_right_to_left.gif) |
| .topBottom | ![](../Assets/sliding_top_to_bottom.gif) |
| .bottomTop | ![](../Assets/sliding_bottom_to_top.gif) |
| .topLeftBottomRight | ![](../Assets/sliding_topLeft_to_bottomRight.gif) |
| .bottomRightTopLeft | ![](../Assets/sliding_bottomRight_to_topLeft.gif) |
> **๐ ๊ฟํ!**
์ฌ๋ผ์ด๋ฉ ์ ๋๋ฉ์ด์
์ ๋ง๋ค๊ธฐ ์ํ ๋๋ค๋ฅธ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค, ์๋์ ์ฝ๋๋ฅผ ์ฐธ์กฐํ์ธ์:
>>```let animation = GradientDirection.leftToRight.slidingAnimation()```
### ๐จโ๐งโ๐ฆ ๊ณ์ธต ๊ตฌ์กฐ
```SkeletonView```๋ ์ฌ๊ท์ ์
๋๋ค , ๊ทธ๋ฆฌ๊ณ ์ฐ๋ฆฌ๋ skeleton์ด ํจ์จ์ ์ผ๋ก ์๋ํ๊ธฐ๋ฅผ ์ํ๊ธฐ ๋๋ฌธ์, ๊ฐ๋ฅํ ๋นจ๋ฆฌ ์ฌ๊ท์์
์ ์ค๋จํ๊ธฐ๋ฅผ ์ํฉ๋๋ค. ์ด๋ฌํ ์ด์ ๋๋ฌธ์ ๋ฐ๋์ ์ปจํ
์ด๋ ๋ทฐ๋ฅผ `Skeletonable` ๋ก ์ค์ ํด์ผ ํฉ๋๋ค, `skeletonable` ๋์ง ์๋ ๋ทฐ๋ฅผ ๋ง๋๋ ์๊ฐ ์ฌ๊ท ์์
์ ์ค๋จํ๊ธฐ ๋๋ฌธ์
๋๋ค.
์๋์ ์ด๋ฏธ์ง๋ฅผ ์ฐธ๊ณ ํ์ธ์ ์ด๋ฏธ์ง๋ ํ๋์ ์ดํด๋์ค๊ฒ๋๋ค:
> ```รฌsSkeletonable```= โ ๏ธ
| ์ค์ ๊ฐ | ๊ฒฐ๊ณผ |
| ----------------------------------------- | --------------------------------------------- |
| ![](../Assets/no_skeletonable.png) | ![](../Assets/no_skeletonables_result.png) |
| ![](../Assets/container_no_skeletonable.png) | ![](../Assets/no_skeletonables_result.png) |
| ![](../Assets/container_skeletonable.png) | ![](../Assets/container_skeletonable_result.png) |
| ![](../Assets/all_skeletonables.png) | ![](../Assets/all_skeletonables_result.png) |
### ๐ฌ ๋๋ฒ๊ทธ
**์๋ก์ด์์** ์ด๋ค๊ฒ๋ค์ด ์ ๋์ ํ์ง ์์๋๋ฅผ ์ํด ๋๋ฒ๊ทธ ์์
์ ์ฉ์ดํ๊ฒ ํ๊ธฐ ์ํด์ `SkeletonView` ์๋ ๋ช๊ฐ์ง ์๋ก์ด ๊ฒ๋ค์ด ์์ต๋๋ค.
์ฒซ๋ฒ์จฐ๋ก, `UIView` ์์ skeleton ์ ๋ณด๋ฅผ ๋ณด๊ธฐ์ํด ๋ค์๊ณผ ๊ฐ์ด ์ง์ํ๊ณ ์์ต๋๋ค:
```swift
var skeletonDescription: String
```
skeleton์ ์ด๋ ๊ฒ ์๊ฒผ์ต๋๋ค:
![](../Assets/debug_description.png)
๊ทธ๋ฆฌ๊ณ , ์๋ก์ด **๋๋ฒ๊ทธ ๋ชจ๋**๋ฅผ ํ์ฑํ ์ํฌ ์ ์์ต๋๋ค. ๊ฐ๋จํ๊ฒ `SKELETON_DEBUG` ์ด๋ผ๋ ํ๊ฒฝ ๋ณ์๋ฅผ ์ถ๊ฐํด ํ์ฑํ ํ๋ฉด ๋ฉ๋๋ค.
![](../Assets/debug_mode.png)
๊ทธ๋ฐ ์ดํ skeleton์ด ๋์ค๋ฉด Xcode ์ฝ์์ฐฝ์์ ๊ณ์ธต ๊ตฌ์กฐ๋ฅผ ๋ณผ ์ ์์ต๋๋ค.
์์ ๋ฅผ ํ์ธํด๋ณด์ธ์.
### ๐ ๋ฌธ์ํ
์กฐ๊ธ๋ง ๊ธฐ๋ค๋ ค์ฃผ์ธ์...๐
### ๐ ์ง์ ๊ฐ๋ฅํ OS & SDK ๋ฒ์
* iOS 9.0+
* tvOS 9.0+
* Swift 4.2
## ๐ฌ ์์ ๋ ๊ธฐ๋ฅ๋ค
* [x] ๋ฉํฐ๋ผ์ธ ์์์ ๋ง์ง๋ง ๋ผ์ธ์ ์ฑ์ฐ๊ธฐ ๋น์จ ์ค์
* [x] ๋๋ง์ ๊ทธ๋ผ๋์ธํธ ์ ๋๋ฉ์ด์
* [x] resizable cells ์ง์
* [x] CollectionView ํธํ
* [x] tvOS ํธํ
* [x] recovery state ์ถ๊ฐ
* [x] Custom default appearance
* [x] ๋๋ฒ๊ทธ ๋ชจ๋
* [ ] Custom collections ํธํ
* [ ] skeletons ๊ฐ ๋ณด์ด๊ฑฐ๋ ๊ฐ๋ ค์ง๋ ์ ๋๋ฉ์ด์
์ถ๊ฐ
* [ ] MacOS ์ WatchOS ํธํ
## โค๏ธ ๊ธฐ์ฌํ๊ธฐ
์ด ํ๋ก์ ํธ๋ ์คํ์์ค ํ๋ก์ ํธ ์
๋๋ค, ๋ง์ํธํ๊ฒ ๊ธฐ์ฌํด์ฃผ์๋ฉด ๋ฉ๋๋ค ์ด๋ป๊ฒ ํ๋๊ตฌ์?
- ์๋ก์ด [์ด์](https://github.com/Juanpe/SkeletonView/issues/new)๋ฅผ ๋ฑ๋กํฉ๋๋ค.
- [email](mailto://juanpecatalan.com)์ ๋ณด๋
๋๋ค.
- ๋น์ ์ ์์ ์ ์ ์ํฉ๋๋ค, pull request๋ฅผ ํฌํจํ ์์ ์ ๊ถ์ฅํฉ๋๋ค.
์ ์ฒด [๊ธฐ์ฌ์๋ชฉ๋ก](https://github.com/Juanpe/SkeletonView/graphs/contributors)
###### [SwiftPlate](https://github.com/JohnSundell/SwiftPlate)๋ฅผ ํตํด ํ๋ก์ ํธ๊ฐ ์์ฑ๋์์ต๋๋ค
## ๐ข ์์๋ค
- [iOS Dev Weekly #327](https://iosdevweekly.com/issues/327#start)
- [Hacking with Swift Articles](https://www.hackingwithswift.com/articles/40/skeletonview-makes-loading-content-beautiful)
- [Top 10 Swift Articles November](https://medium.mybridge.co/swift-top-10-articles-for-the-past-month-v-nov-2017-dfed7861cd65)
- [30 Amazing iOS Swift Libraries (v2018)](https://medium.mybridge.co/30-amazing-ios-swift-libraries-for-the-past-year-v-2018-7cf15027eee9)
- [AppCoda Weekly #44](http://digest.appcoda.com/issues/appcoda-weekly-issue-44-81899)
- [iOS Cookies Newsletter #103](https://us11.campaign-archive.com/?u=cd1f3ed33c6527331d82107ba&id=48131a516d)
- [Swift Developments Newsletter #113](https://andybargh.com/swiftdevelopments-113/)
- [iOS Goodies #204](http://ios-goodies.com/post/167557280951/week-204)
- [Swift Weekly #96](http://digest.swiftweekly.com/issues/swift-weekly-issue-96-81759)
- [CocoaControls](https://www.cocoacontrols.com/controls/skeletonview)
- [Awesome iOS Newsletter #74](https://ios.libhunt.com/newsletter/74)
- [Swift News #36](https://www.youtube.com/watch?v=mAGpsQiy6so)
## ๐จ๐ปโ๐ป ๊ฐ๋ฐ์
[1.1]: http://i.imgur.com/tXSoThF.png
[1]: http://www.twitter.com/JuanpeCatalan
* Juanpe Catalรกn [![alt text][1.1]][1]
## ๐ฎ๐ป ๋ผ์ด์ผ์ค
```
MIT License
Copyright (c) 2017 Juanpe Catalรกn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```