Bugfix/tableview insetgrouped (#494)

* Fixed TableView skeleton cannot hide if style is insetGrouped

* Fixed show skeleton button not visible

* Update the fix base on PR comments
This commit is contained in:
Tom Cheung
2022-08-16 16:35:13 +08:00
committed by GitHub
parent fbc2e6f8d2
commit 969f068480
2 changed files with 14 additions and 8 deletions
@@ -2,13 +2,8 @@
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
"platform" : "universal",
"reference" : "systemBlueColor"
},
"idiom" : "universal"
},
@@ -21,7 +21,18 @@ extension UITableView {
// Some developer trying to call `view.showAnimatedSkeleton()`
// when the request or data is loading which sometimes happens before the ViewDidAppear
guard window != nil else { return [] }
return subviews
var result = [UIView]()
for subview in subviews {
if String(describing: type(of: subview)) == "UITableViewWrapperView" {
result.append(contentsOf: subview.subviews)
} else {
result.append(subview)
}
}
return result
}
}