forked from Juanpe/SkeletonView
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Juanpe Catalán
committed
Aug 10, 2018
1 parent
4138677
commit 90b993a
Showing
6 changed files
with
101 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,48 @@ | ||
// | ||
// SubviewsSkeletonables.swift | ||
// SkeletonView | ||
// | ||
// Created by Juanpe Catalán on 05/05/2018. | ||
// Copyright © 2018 SkeletonView. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIView { | ||
@objc var subviewsSkeletonables: [UIView] { | ||
return subviews.filter { $0.isSkeletonable } | ||
return subviewsToSkeleton.filter { $0.isSkeletonable } | ||
} | ||
|
||
@objc var subviewsToSkeleton: [UIView] { | ||
return subviews | ||
} | ||
} | ||
|
||
extension UITableView { | ||
override var subviewsSkeletonables: [UIView] { | ||
return visibleCells.filter { $0.isSkeletonable } | ||
|
||
override var subviewsToSkeleton: [UIView] { | ||
return visibleCells | ||
} | ||
} | ||
|
||
extension UITableViewCell { | ||
override var subviewsSkeletonables: [UIView] { | ||
return contentView.subviews.filter { $0.isSkeletonable } | ||
|
||
override var subviewsToSkeleton: [UIView] { | ||
return contentView.subviews | ||
} | ||
} | ||
|
||
extension UICollectionView { | ||
override var subviewsSkeletonables: [UIView] { | ||
return subviews.filter { $0.isSkeletonable } | ||
|
||
override var subviewsToSkeleton: [UIView] { | ||
return subviews | ||
} | ||
} | ||
|
||
extension UICollectionViewCell { | ||
override var subviewsSkeletonables: [UIView] { | ||
return contentView.subviews.filter { $0.isSkeletonable } | ||
|
||
override var subviewsToSkeleton: [UIView] { | ||
return contentView.subviews | ||
} | ||
} | ||
|
||
extension UIStackView { | ||
override var subviewsSkeletonables: [UIView] { | ||
return arrangedSubviews.filter { $0.isSkeletonable } | ||
|
||
override var subviewsToSkeleton: [UIView] { | ||
return arrangedSubviews | ||
} | ||
} |