Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Master #3

wants to merge 3 commits into from

Conversation

klevison
Copy link

@klevison klevison commented Dec 7, 2016

Radius property created to change blur level of preview image. Demo project changed.

@@ -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? {
Copy link
Contributor

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

Copy link
Author

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?

Copy link
Contributor

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) {
Copy link
Contributor

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

Copy link
Author

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.

@serejahh
Copy link
Contributor

Hi @klevison. Thanks for the PR. I'm not sure if it's should be merged to the repo

@klevison
Copy link
Author

Ok whether you don't want to merge it, but for me it was very useful. I just want to use a custom radius :)

@serejahh
Copy link
Contributor

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

@klevison
Copy link
Author

Its ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants