From 7bda28647c4f872f51a5900d066f6bf37c46247f Mon Sep 17 00:00:00 2001 From: Steven Deutsch Date: Wed, 26 Apr 2017 00:01:44 -0500 Subject: [PATCH 1/3] Fix isOpaque bug --- IBAnimatable/FillDesignable.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/IBAnimatable/FillDesignable.swift b/IBAnimatable/FillDesignable.swift index ea7111e4..21b4f917 100644 --- a/IBAnimatable/FillDesignable.swift +++ b/IBAnimatable/FillDesignable.swift @@ -23,11 +23,9 @@ public extension FillDesignable where Self: UIView { public func configureOpacity() { if !opacity.isNaN && opacity >= 0 && opacity <= 1 { alpha = opacity - + // Make better performance - if opacity == 1 { - isOpaque = true - } + isOpaque = opacity == 1 } } } From 3b25c4da144bbf63d31382382dff915aabad1417 Mon Sep 17 00:00:00 2001 From: Steven Deutsch Date: Wed, 26 Apr 2017 00:02:56 -0500 Subject: [PATCH 2/3] Set backgroundColor on contentView for UICollectionViewCell --- IBAnimatable/FillDesignable.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/IBAnimatable/FillDesignable.swift b/IBAnimatable/FillDesignable.swift index 21b4f917..5739a83a 100644 --- a/IBAnimatable/FillDesignable.swift +++ b/IBAnimatable/FillDesignable.swift @@ -23,7 +23,7 @@ public extension FillDesignable where Self: UIView { public func configureOpacity() { if !opacity.isNaN && opacity >= 0 && opacity <= 1 { alpha = opacity - + // Make better performance isOpaque = opacity == 1 } @@ -42,6 +42,18 @@ public extension FillDesignable where Self: UITableViewCell { } } +public extension FillDesignable where Self: UICollectionViewCell { + public func configureFillColor() { + if let fillColor = fillColor { + backgroundColor = fillColor + contentView.backgroundColor = fillColor + } else if let predefinedColor = predefinedColor?.color { + backgroundColor = predefinedColor + contentView.backgroundColor = predefinedColor + } + } +} + private extension FillDesignable { func predefinedColor(string predefinedColor: String?) -> UIColor? { From 3156b73c8fbe4d8150085a78eea3f0fff02e3687 Mon Sep 17 00:00:00 2001 From: Steven Deutsch Date: Wed, 26 Apr 2017 23:23:24 -0500 Subject: [PATCH 3/3] Update CHANGELOG.md for #462 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ec64b0..902aa231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ N/A - `AnimatableTextField` won't override anymore the default border if no custom one set. [#457](https://github.com/IBAnimatable/IBAnimatable/pull/457) by [tbaranes](https://github.com/tbaranes) - Make `placeholderColor` working with `placeholderText` AND `placehodler`. It will keep the current priorirty: `placeholderText` > `placehodler`. [#459](https://github.com/IBAnimatable/IBAnimatable/pull/459) by [@tbaranes](https://github.com/tbaranes) - +- Fix `FillDesignable` protocol to set `fillColor` for `UICollectionViewCell`. [#462](https://github.com/IBAnimatable/IBAnimatable/pull/462) by [@SD10](https://github.com/SD10) --- ### [4.0.0](https://github.com/IBAnimatable/IBAnimatable/releases/tag/4.0.0)