UIImage in SwiftUI

Hi, I have a problem with the following code:
Code Block Swift
struct AddView: View {
  @State var text:String = ""
  @State private var image : UIImage?
  @State private var showingPicker = false
  @Binding var listItems: [Item]
  @State private var inputImage : UIImage?
  var body: some View {
     
    VStack{
      TextField("Name", text: $text).padding().background(Color(.systemGray5)).frame(width: 400,alignment: .center).cornerRadius(20)
      Image(systemName: "person.circle")
        .frame(width: 170, height: 170, alignment: .center)
        .clipShape(Circle())
        .shadow(radius: 10)
        .overlay(Circle()
        .stroke(Color.blue))
        .position(x: 209, y: 100)
        .onTapGesture {
          self.showingPicker = true
             
        }.sheet(isPresented: $showingPicker, onDismiss: loadImage){
          ImagePicker(image: self.$inputImage)
        }
       
       
      Button(action: {
        listItems.append(Item(name: text, image: inputImage))
        UserDefaults.standard.saveItems(listItems)
        print(listItems)
        
         
         
         
      }, label: {
        Text("Add")
      })
    }
  }
  func loadImage(){
    guard let inputImage1 = inputImage else {
      image = inputImage
      return
    }
  }
}
extension UserDefaults {
  func saveItems(_ items: [Item]) {
    let encoder = JSONEncoder()
    if let data = try? encoder.encode(items) {
      set(data, forKey: "Items")
    }
  }
}
struct ImagePicker : UIViewControllerRepresentable{
   
  class Coordinator : NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate{
    let parent : ImagePicker
    init(_ parent: ImagePicker){
      self.parent = parent
    }
     
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info:[UIImagePickerController.InfoKey : Any]){
      if let uiImage = info[.originalImage] as? UIImage{
        parent.image = uiImage
      }
      parent.presentaitionMode.wrappedValue.dismiss()
    }
  }
   
  @Environment(\.presentationMode) var presentaitionMode
  @Binding var image : UIImage?
   
  func makeCoordinator() -> Coordinator {
    Coordinator(self)
  }
   
   
   
  func makeUIViewController(context: UIViewControllerRepresentableContext<ImagePicker>) -> UIImagePickerController{
    let picker = UIImagePickerController()
    picker.delegate = context.coordinator
    return picker
  }
  func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext<ImagePicker>) {
     
  }
}

Code Block Swift
struct Item : Identifiable, Codable{
  var id = UUID()
  var name : String
  var image : String
   
}

When I want to append an Image to the listItems, I get the following Error:

Cannot convert value of type 'UIImage?' to expected argument type 'String'

I don't know what I can do to change it, because when I change the Type of image in Item to UIImage, I get these errors:

Type 'Item' does not conform to protocol 'Decodable'
Type 'Item' does not conform to protocol 'Identifiable'

What can I do?

I don't know what I can do to change it, because when I change the Type of image in Item to UIImage, I get these errors:
Type 'Item' does not conform to protocol 'Decodable'
Type 'Item' does not conform to protocol 'Identifiable'
What can I do?

It seems to be the most important part. How do you want to use Item in other parts of your code?
Just want to store into UserDefaults and the property image is never used?
(By the way, UserDefaults is not a place to store images. It is a place to store Settings-like small amounts of data.)

Generally, using String is sort of ridiculous where you want to store an image.
UIImage in SwiftUI
 
 
Q