Create one none case which return false and call that case when 3D touch start and call select case when 3D touch ended.
override public func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool
{
switch self.currentState {
case .select:
if action == #selector(select(_:)) || action == #selector(selectAll(_:))
{
return true
}
case .copy:
if action == #selector(copy(_:))
{
return true
}
case .paste:
if action == #selector(paste(_:)) || action == #selector(select(_:)) || action == #selector(selectAll(_:))
{
return true
}
case .none:
return false
}
return false
}