1.UIAlertController,将UIAlertView和UIActionSheet进行了统一,用法如下:
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:nil preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
NSLog(@"取消");
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
NSLog(@"确定");
}]];
[self presentViewController:alert animated:YES completion:nil];
2.UIBlurEffect和UIVisualEffectView实现高斯模糊,用法如下:
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blur];
effectView.frame = CGRectMake(0, 0, self.myImageView.image.size.width, self.myImageView.image.size.height);
[self.myImageView addSubview:_effectView];