From 9381113c81529b35c1f42c1b0498758263064265 Mon Sep 17 00:00:00 2001 From: Henrik Storch Date: Tue, 4 Oct 2022 10:51:42 +1300 Subject: [PATCH 1/2] Fix example table view textfield Sometimes disappears, sometimes first is visible. --- Examples/iOS Example/Sources/ViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/iOS Example/Sources/ViewController.swift b/Examples/iOS Example/Sources/ViewController.swift index cb80e51c..bf823836 100644 --- a/Examples/iOS Example/Sources/ViewController.swift +++ b/Examples/iOS Example/Sources/ViewController.swift @@ -181,6 +181,7 @@ extension ViewController: SkeletonTableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "CellIdentifier", for: indexPath) as! Cell cell.label1.text = "cell -> \(indexPath.row)" + cell.textField.isHidden = indexPath.row == 0 return cell } From 4c09c66c3d29f1ab9ccbc183da926336d7f1be46 Mon Sep 17 00:00:00 2001 From: Henrik Storch Date: Tue, 4 Oct 2022 12:03:04 +1300 Subject: [PATCH 2/2] Fix collection/table-view hidden views shown briefly When skeletonizing hidden views in a cell the transition causes them to briefly show for for just a fraction of a second. Just ignoring the transition in this case resolves this. --- .../Sources/Internal/UIKitExtensions/UIView+Transitions.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+Transitions.swift b/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+Transitions.swift index 66b3a610..ce90bbee 100644 --- a/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+Transitions.swift +++ b/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+Transitions.swift @@ -6,7 +6,9 @@ extension UIView { func startTransition(transitionBlock: @escaping () -> Void) { guard let transitionStyle = _currentSkeletonConfig?.transition, - transitionStyle != .none else { + transitionStyle != .none, + // transition causes hidden view to show + !isHidden else { transitionBlock() return }