-
Notifications
You must be signed in to change notification settings - Fork 46
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
Master #3
base: master
Are you sure you want to change the base?
Master #3
Conversation
@@ -105,8 +105,8 @@ import UIKit | |||
import Accelerate | |||
|
|||
public extension UIImage { | |||
public func applyLightEffect() -> UIImage? { | |||
return applyBlurWithRadius(30, tintColor: UIColor(white: 1.0, alpha: 0.3), saturationDeltaFactor: 1.8) | |||
public func applyLightEffect(radius: CGFloat) -> UIImage? { |
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.
It has the same radius as UIBlurEffectStyleLight. You mustn't change radius here
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.
In my project I don't want to use default UIBlurEffectStyleLight, so why not another value?
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.
You should create a new effect instead of changing this one
setupSubviews() | ||
} | ||
|
||
init(image: UIImage?, radius: CGFloat) { |
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.
If should have a default radius to not break API
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.
let defaultRadius: CGFloat = 30
(line 25) is the default radius.
Hi @klevison. Thanks for the PR. I'm not sure if it's should be merged to the repo |
Ok whether you don't want to merge it, but for me it was very useful. I just want to use a custom radius :) |
The first version was implemented with UIVisualEffectView and you can't change radius there. But UIVisualEffectView doesn't work properly on iOS 10, so it's just a temporary solution |
Its ok |
Radius property created to change blur level of preview image. Demo project changed.