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

StarWarsAnimator: try to make snapshot blurEffect and corner #8

Open
csjlengxiang opened this issue Dec 4, 2016 · 0 comments
Open

Comments

@csjlengxiang
Copy link

csjlengxiang commented Dec 4, 2016

I try make the snapshots in dismiss animation have blurEffect and corner.
let snapshot = (fromViewSnapshot!.resizableSnapshotView(from: snapshotRegion, afterScreenUpdates: false, withCapInsets: UIEdgeInsets.zero))!

blurEffect: I just add UIVisualEffectView to fromView and then
let fromViewSnapshot = fromView?.snapshotView(afterScreenUpdates: true)
this work well. all snapshot blurEffect.

but make snapshot corner I fail.

first i just use this
snapshot.layer.cornerRadius = width / 2
snapshot.layer.masksToBounds = true
but this have performance problems.

I try to solve this by use UIGraphicsGetCurrentContext clip the snapshot. by use
first. clip snapshot to image like http://stackoverflow.com/questions/25444609/screenshot-in-swift-ios. then clip image. and add image to imageview. at last. add it to containerView
but it not work. I do not know where is wrong.

sorry about my poor English.

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

No branches or pull requests

4 participants