The final step in this tutorial is to apply the sepia filter to the image when the Button in the content view is tapped. This will make use of the CoreImage Framework and involves converting the UIImage to a CIImage and applying the sepia tone filter before being converted back to a UIImage. Edit the ContentView.swift file and make the following changes:
import SwiftUI
import CoreImage
import CoreImage.CIFilterBuiltins
struct ContentView: View {
@Binding var document: ImageDocDemoDocument
@State private var ciFilter = CIFilter.sepiaTone()
let context = CIContext()
var body: some View {
VStack {
Image(uiImage: document.image...