An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/AlphaWalletShare/ItemType.swift

43 lines
944 B

//
// ItemType.swift
// AlphaWallet
//
// Created by Vladyslav Shepitko on 11.11.2020.
//
import Foundation
import Social
import MobileCoreServices
extension NSItemProvider {
enum ItemType {
case url
case text
case unknown
init(_ value: NSItemProvider) {
if value.hasItemConformingToTypeIdentifier(kUTTypeURL as String) {
self = .url
} else if value.hasItemConformingToTypeIdentifier(kUTTypeText as String) {
self = .text
} else {
self = .unknown
}
}
var rawValue: String {
switch self {
case .url:
return kUTTypeURL as String
case .text:
return kUTTypeText as String
case .unknown:
return String()
}
}
}
var type: ItemType {
return ItemType(self)
}
}