0
votes

I have collectionView Cell In that i have this text,I want to blur the text as shown in image.

I have tried Using UIVisualEffect but i didnt get exact response.

Code: UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();

   //Blur the UIImage with a CIFilter
    CIImage *imageToBlur = [CIImage       imageWithCGImage:viewImage.CGImage];
    CIFilter *gaussianBlurFilter = [CIFilter filterWithName: @"CIGaussianBlur"];
    [gaussianBlurFilter setValue:imageToBlur forKey: @"inputImage"];
    [gaussianBlurFilter setValue:[NSNumber numberWithFloat: 10] forKey: @"inputRadius"];
    CIImage *resultImage = [gaussianBlurFilter valueForKey: @"outputImage"];
    UIImage *endImage = [[UIImage alloc] initWithCIImage:resultImage];
    //Place the UIImage in a UIImageView
    UIImageView *newView = [[UIImageView alloc] initWithFrame:self.bounds];
    newView.image = endImage;
    [self addSubview:newView];
1
Post some of your code so we can have a look at what you've tried.Haligen
@Haligen i have added UIVisualEffect in xib and also i have used Gaussian Blur and the code i have used is edited aboveDiksha
Is each car model in your posted image an individual cell, or are they all in one cell, and where is your above code placed at? Custom cell class? View Controller Class?Haligen
@Haligen it is custom cell in which all the models are individual cells respectively,Above code is placed in custom cellDiksha
Is there any solution for this,am stucked here for many days..:(Diksha

1 Answers

0
votes

Create an UIImage with Gaussian Blur and add image onto this textField or Button (whatever you have).