Reputation: 657
UIView *myView = self;
CALayer *layer = [myView layer];
[layer setRasterizationScale:0.25];
[layer setShouldRasterize:YES];
I found this code somewhere except the problem is that when I use it it says the methods are not found. Also, when I type layer. and press escape to see all the properties for autocomplete I see none so is can you please help me figure out the problem, maybe I'm not importing something? Please help and thanks in advance
Upvotes: 1
Views: 601
Reputation: 3402
Hello Aspyn,
You will try this code this will help you
First of all add QuartzCore.framework from existing framework and .m file you import this framework as follow
#import <QuartzCore/QuartzCore.h>
UIView *myView = self;
CALayer *layer = [myView layer];
[layer setRasterizationScale:0.25];
[layer setShouldRasterize:YES];
[layer setContentsScale:UIViewContentModeScaleAspectFit];
Upvotes: 1
Reputation: 384
You have to import Quartz-core framework from the existing framework and add it to your project,and import in the .h class.
Upvotes: 3