-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIVibrancyEffect designable #245
Conversation
@tbaranes Yes, this is exactly what I was looking for. Adding all subviews to |
That means each subviews which will have a vibrancy applied will have be an
Just tried it by applying the vibrancy on all subviews, and it seems to work! |
private func configInspectableProperties() { | ||
configAnimatableProperties() | ||
configTintedColor() | ||
configBlurEffectStyle() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need that any more? Since we have called it in didSet
Both solutions have pros and cons. I like the apply to all subviews solution more because
|
@@ -10,7 +10,7 @@ public protocol BlurDesignable { | |||
blur effect style: `ExtraLight`, `Light` or `Dark` | |||
*/ | |||
var blurEffectStyle: String? { get set } | |||
|
|||
var vibrancyEffectStyle: String? { get set } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May add a comment here.
/**
Vibrancy effect style: `ExtraLight`, `Light` or `Dark`. Once specify the Vibrancy effect style, all subviews will apply this vibrancy effect.
*/
All comments have been treated 👍 BuddyBuild is failing again. Is it really useful? |
@tbaranes I have contacted BuddyBuild again to fix it. There are some issues with singing. |
I started the implementation of vibrancy designable (close #243), up to now it's working well but I have one issue which deserve more thought.
The vibrancy is applied to its subviews while the blur is applied to everything below it. While using in interface builder, the blur is working well since we don't have to think about which view is parent of who, but for the vibrancy we have to know who will be its subviews. Since we can't use two different views to differentiate the vibrancy and the blur (they are fully related and can't work independently), how to add the subviews which will have the vibrancy effect applied?
The only option I find until now is to consider that all the subviews of the
AnimatableView
will be removed and then added to thevibrancyView
which means, all the subviews will have a vibrancy without exception. That could be a good solution, but I'm expecting incomprehension when using the feature.That option can be a bit extended by considering adding an
applyVibrancy
boolean to each subviews, but I'm not really fan of this.Beside that, it's working well:
The left image has been added programatically to the vibrancyView whereas the right one is a classic subview.
@JakeLin @f1nality Any suggestions about this issue?
@f1nality Is that what you were expecting or did you have another idea in mind?