Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d09a5d75ee | |||
| 8ab04f8108 | |||
| f5d0620a57 | |||
| 8ddd4ccd27 | |||
| 57aa984a01 | |||
| 7a0c45a47e | |||
| 30fd5aa762 | |||
| 14b0248612 | |||
| 6b914ba1d5 | |||
| 3dac6c7f2f | |||
| 1a6ab34e7b | |||
| 601dc7a4e0 | |||
| ec3398bda0 | |||
| 5a75e00604 | |||
| 906c1845d3 | |||
| 8a2a512bbb | |||
| e6eb35e139 | |||
| 9c66a4b74c |
+14
-4
@@ -6,9 +6,19 @@ All notable changes to this project will be documented in this file
|
||||
#### 🙌 New
|
||||
|
||||
#### 🔬Improvements
|
||||
|
||||
|
||||
#### 🩹 Bug fixes
|
||||
|
||||
### 📦 [1.8.7](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.7)
|
||||
|
||||
#### 🔬Improvements
|
||||
* [**271**](https://github.com/Juanpe/SkeletonView/pull/271): Add corner radius for skeletonView as IBInspectable (CGFloat) default is 0.0 - [@paulanatoleclaudot-betclic](https://github.com/paulanatoleclaudot-betclic)
|
||||
|
||||
#### 🩹 Bug fixes
|
||||
* [**259**](https://github.com/Juanpe/SkeletonView/issues/259): Prevent isSkeletonActive to be called when isSkeletonable is false - [@wsalim1610](https://github.com/wsalim1610)
|
||||
* [**274**](https://github.com/Juanpe/SkeletonView/pull/274): Fix: hiding skeleton when header and footer views of section would not hide it - [@darkside999](https://github.com/darkside999)
|
||||
* [**273**](https://github.com/Juanpe/SkeletonView/pull/273): Fix: in vertical stack view with center alignment show incorrect position - [@koooootake](https://github.com/koooootake)
|
||||
|
||||
### 📦 [1.8.6](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.6)
|
||||
|
||||
#### 🔬Improvements
|
||||
@@ -17,7 +27,7 @@ All notable changes to this project will be documented in this file
|
||||
* [**263**](https://github.com/Juanpe/SkeletonView/pull/263): Feature/set cross dissolve transitions as default - [@Juanpe](https://github.com/Juanpe)
|
||||
* [**264**](https://github.com/Juanpe/SkeletonView/pull/264): not replace original datasource is running XCTests - [@Juanpe](https://github.com/Juanpe)
|
||||
* [**265**](https://github.com/Juanpe/SkeletonView/pull/265): call original traitCollectionDidChange method - [@Juanpe](https://github.com/Juanpe)
|
||||
|
||||
|
||||
#### 🩹 Bug fixes
|
||||
* [**260**](https://github.com/Juanpe/SkeletonView/issues/260): Don't hide skeleton layers on TableViewHeaderFooterView
|
||||
* [**257**](https://github.com/Juanpe/SkeletonView/issues/257): Unit test problem when using SkeletonView
|
||||
@@ -30,7 +40,7 @@ All notable changes to this project will be documented in this file
|
||||
### 📦 [1.8.2](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.2)
|
||||
|
||||
#### 🙌 New
|
||||
- Add ability to customize line spacing per label. (thanks @gshahbazian)
|
||||
- Add ability to customize line spacing per label. (thanks @gshahbazian)
|
||||
|
||||
### 📦 [LayoutSkeleton (1.8.1)](https://github.com/Juanpe/SkeletonView/releases/tag/1.8.1)
|
||||
|
||||
@@ -38,7 +48,7 @@ All notable changes to this project will be documented in this file
|
||||
- Fix completion call in .none transition style while hide skeletons. (thanks @aadudyrev)
|
||||
|
||||
#### 🙌 New
|
||||
- Swizzle `layoutSubviews` method.
|
||||
- Swizzle `layoutSubviews` method.
|
||||
|
||||
#### 🔬Improvements
|
||||
- Fix completion call in .none transition style while hiding skeletons. (thanks @aadudyrev)
|
||||
|
||||
@@ -349,6 +349,8 @@ Default values:
|
||||
- *default: 70*
|
||||
- **multilineCornerRadius**: Int
|
||||
- *default: 0*
|
||||
- **skeletonCornerRadius**: CGFloat (IBInspectable) (Make your skeleton view with corner)
|
||||
- *default: 0*
|
||||
|
||||
To get these default values you can use `SkeletonAppearance.default`. Using this property you can set the values as well:
|
||||
```Swift
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SkeletonView"
|
||||
s.version = "1.8.6"
|
||||
s.version = "1.8.7"
|
||||
s.summary = "An elegant way to show users that something is happening and also prepare them to which contents he is waiting"
|
||||
s.description = <<-DESC
|
||||
Today almost all apps have async processes, as API requests, long runing processes, etc. And while the processes are working, usually developers place a loading view to show users that something is going on.
|
||||
|
||||
@@ -42,6 +42,16 @@ extension SkeletonCollectionDelegate: UITableViewDelegate {
|
||||
return nil
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, didEndDisplayingHeaderView view: UIView, forSection section: Int) {
|
||||
view.hideSkeleton()
|
||||
originalTableViewDelegate?.tableView?(tableView, didEndDisplayingHeaderView: view, forSection: section)
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, didEndDisplayingFooterView view: UIView, forSection section: Int) {
|
||||
view.hideSkeleton()
|
||||
originalTableViewDelegate?.tableView?(tableView, didEndDisplayingFooterView: view, forSection: section)
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
|
||||
cell.hideSkeleton()
|
||||
originalTableViewDelegate?.tableView?(tableView, didEndDisplaying: cell, forRowAt: indexPath)
|
||||
|
||||
@@ -13,6 +13,7 @@ enum ViewAssociatedKeys {
|
||||
static var labelViewState = "labelViewState"
|
||||
static var imageViewState = "imageViewState"
|
||||
static var currentSkeletonConfig = "currentSkeletonConfig"
|
||||
static var skeletonCornerRadius = "skeletonCornerRadius"
|
||||
}
|
||||
// codebeat:enable[TOO_MANY_IVARS]
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ extension UIView {
|
||||
if let parentStackView = (superview as? UIStackView) {
|
||||
var origin: CGPoint = .zero
|
||||
switch parentStackView.alignment {
|
||||
case .center:
|
||||
origin.x = maxWidthEstimated / 2
|
||||
case .trailing:
|
||||
origin.x = maxWidthEstimated
|
||||
default:
|
||||
|
||||
@@ -8,6 +8,12 @@ public extension UIView {
|
||||
get { return skeletonable }
|
||||
set { skeletonable = newValue }
|
||||
}
|
||||
|
||||
@IBInspectable
|
||||
var skeletonCornerRadius: Float {
|
||||
get { return skeletonableCornerRadius }
|
||||
set { skeletonableCornerRadius = newValue }
|
||||
}
|
||||
|
||||
var isSkeletonActive: Bool {
|
||||
return status == .on || (subviewsSkeletonables.first(where: { $0.isSkeletonActive }) != nil)
|
||||
@@ -17,5 +23,10 @@ public extension UIView {
|
||||
get { return ao_get(pkey: &ViewAssociatedKeys.skeletonable) as? Bool ?? false }
|
||||
set { ao_set(newValue ?? false, pkey: &ViewAssociatedKeys.skeletonable) }
|
||||
}
|
||||
|
||||
private var skeletonableCornerRadius: Float! {
|
||||
get { return ao_get(pkey: &ViewAssociatedKeys.skeletonCornerRadius) as? Float ?? 0.0 }
|
||||
set { ao_set(newValue ?? 0.0, pkey: &ViewAssociatedKeys.skeletonCornerRadius) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ struct SkeletonLayer {
|
||||
self.maskLayer = type.layer
|
||||
self.maskLayer.anchorPoint = .zero
|
||||
self.maskLayer.bounds = holder.maxBoundsEstimated
|
||||
self.maskLayer.cornerRadius = CGFloat(holder.skeletonCornerRadius)
|
||||
addTextLinesIfNeeded()
|
||||
self.maskLayer.tint(withColors: colors)
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ extension UIView {
|
||||
|
||||
@objc func skeletonTraitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||
skeletonTraitCollectionDidChange(previousTraitCollection)
|
||||
guard isSkeletonActive, let config = currentSkeletonConfig else { return }
|
||||
guard isSkeletonable, isSkeletonActive, let config = currentSkeletonConfig else { return }
|
||||
updateSkeleton(skeletonConfig: config)
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ extension UIView {
|
||||
}
|
||||
|
||||
private func recursiveShowSkeleton(skeletonConfig config: SkeletonConfig, root: UIView? = nil) {
|
||||
guard !isSkeletonActive && isSkeletonable else { return }
|
||||
guard isSkeletonable && !isSkeletonActive else { return }
|
||||
currentSkeletonConfig = config
|
||||
swizzleLayoutSubviews()
|
||||
swizzleTraitCollectionDidChange()
|
||||
|
||||
Reference in New Issue
Block a user