//
//  DataType.swift
//  Example
//
//  Created by Sam Ding on 11/17/20.
//

import Foundation
import MobileCoreServices

/**
 Accept the drag items based on these uniform type identifiers (UTIs)
 For all System defined UTIs, check:
 -  https://github.com/mkeiser/SwiftUTI/blob/7a79af868845e6efe28ac7c628b952df8763e845/Sources/SwiftUTI/UTI.swift#L359
 - https://escapetech.eu/manuals/qdrop/uti.html
 */

enum DataType: String, CaseIterable {
  case text
  case url
  case image
  case video
  case audio
  case other

  var baseUTType: String {
    switch self {
    case .text:
      return "public.plain-text"
    case .url:
      return "public.url"
    case .image:
      return "public.image"
    case .video:
      return "public.movie"
    case .audio:
      return "public.audio"
    case .other:
      // Other UTIs
      return "public.data"
    }
  }
}

