Compare commits

..

18 Commits

Author SHA1 Message Date
Juanpe Catalán d09a5d75ee bump version and update CHANGELOG file 2020-03-31 09:34:04 +02:00
Juanpe Catalán 8ab04f8108 Merge pull request #271 from paulanatoleclaudot-betclic/feature/CornerRadiusView
Add corner radius for skeletonView as IBInspectable (CGFloat) default is 0.0
2020-03-19 16:57:31 +01:00
Paul-Anatole CLAUDOT f5d0620a57 [CornerRadiusView] Fill correct changeLog with nextVersion 2020-03-19 15:47:58 +01:00
Paul-Anatole CLAUDOT 8ddd4ccd27 [CornerRadiusView] Modify changeLog according to PR 2020-03-19 09:30:14 +01:00
Juanpe Catalán 57aa984a01 Merge pull request #273 from koooootake/fix_stack_view_alignment_center
FIX: in vertical stack view with center alignment
2020-03-13 16:35:02 +01:00
koooootake 7a0c45a47e Update CHANGELOG.md 2020-03-14 00:22:39 +09:00
koooootake 30fd5aa762 Merge branch 'develop' into fix_stack_view_alignment_center 2020-03-14 00:19:51 +09:00
Juanpe Catalán 14b0248612 Update CHANGELOG.md 2020-03-13 12:18:44 +01:00
Juanpe Catalán 6b914ba1d5 Update CHANGELOG.md 2020-03-13 12:18:15 +01:00
Juanpe Catalán 3dac6c7f2f Merge pull request #274 from darkside999/develop
Fix hiding skeleton when some of views will not hide
2020-03-13 12:17:22 +01:00
Индир 1a6ab34e7b Update CHANGELOG.md 2020-03-13 14:06:45 +03:00
voltmor 601dc7a4e0 Merge branch 'develop' of https://github.com/Juanpe/SkeletonView into develop 2020-03-13 13:56:08 +03:00
Juanpe Catalán ec3398bda0 Merge pull request #275 from BurhanDewantara/259
Fix Issue #259: Prevent isSkeletonActive to be called when isSkeletonable is false
2020-03-13 11:23:24 +01:00
William Salim 5a75e00604 add PR #259 in the CHANGELOG file 2020-03-13 15:21:15 +07:00
voltmor 906c1845d3 Fix hiding skeleton when some of views will not hide 2020-03-11 16:59:22 +03:00
William Salim 8a2a512bbb Prevent isSkeletonActive to be called when isSkeletonable is false 2020-03-11 18:32:23 +07:00
koooootake e6eb35e139 delete case .center 2020-03-09 23:56:56 +09:00
Paul-Anatole CLAUDOT 9c66a4b74c Add corner radius for skeletonView as IBInspectable (CGFloat) default is 0.0 2020-03-03 13:47:08 +01:00
9 changed files with 42 additions and 9 deletions
+14 -4
View File
@@ -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)
+2
View File
@@ -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 -1
View File
@@ -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]
-2
View File
@@ -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) }
}
}
+1
View File
@@ -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)
}
+2 -2
View File
@@ -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()