Skip to content

Master#3

Open
klevison wants to merge 3 commits intoYalantis:masterfrom
klevison:master
Open

Master#3
klevison wants to merge 3 commits intoYalantis:masterfrom
klevison:master

Conversation

@klevison
Copy link
Copy Markdown

@klevison klevison commented Dec 7, 2016

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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@klevison
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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