Skip to content
This repository has been archived by the owner on Jul 12, 2019. It is now read-only.

Change renderInContext to drawViewHierarchyInRect in imageWithView #99

Open
frapsMatheus opened this issue Apr 6, 2016 · 0 comments
Open

Comments

@frapsMatheus
Copy link

Change
[view.layer renderInContext:UIGraphicsGetCurrentContext()];

To:
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];

It runs much faster. From my tests on my app it went from 0.625468s to 0.014225.

Heres is a better explanation on possible choices and it has a link to why it is better:
http://stackoverflow.com/questions/19066717/how-to-render-view-into-image-faster

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

No branches or pull requests

1 participant