MDScratchImageView 刮奖效果
//
// ViewController.m
// 刮奖效果
//
// Created by CJW on 17/1/5.
// Copyright © 2017年 cjw. All rights reserved.
//
#import "ViewController.h"
#import "MDScratchImageView.h"
#import "UIImage+ImageEffects.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//底层图片
UIImage * image = [UIImage imageNamed:@"huan"];
UIImageView * huanImg = [[UIImageView alloc]init];
huanImg.frame = self.view.bounds;
huanImg.image = image;
[self.view addSubview:huanImg];
//被刮图片
MDScratchImageView *scratchIMG = [[MDScratchImageView alloc] initWithFrame:huanImg.frame];
[scratchIMG setImage:[image blurImage] radius:50];
[self.view addSubview:scratchIMG];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end