import UIKit
import CoreImage
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//获得系统内置滤镜的名称,并将滤镜名称放置在数组里
let builtInFilters = CIFilter.filterNames(inCategory: kCICategoryBuiltIn)
for filter in builtInFilters {//对滤镜名称的数组进行遍历
let filter = CIFilter(name: filter as String)//根据滤镜的名称获得滤镜
let attributes = filter!.attributes//获得滤镜所有的属性
print("[\(String(describing: filter))]\n")//在控制台打印输出滤镜信息
print(attributes)//在控制台打印输出滤镜的所有属性
print("\n ------------------------------------------- \n")
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}