std::string CKActionBase::identifier()

in ComponentKit/Core/Action/CKAction.mm [135:155]


std::string CKActionBase::identifier() const noexcept
{
  switch (_variant) {
    case CKActionVariant::RawSelector:
      return std::string(sel_getName((SEL)_selectorOrIdentifier)) + "-Selector";
    case CKActionVariant::TargetSelector:
      return std::string(sel_getName((SEL)_selectorOrIdentifier)) + "-TargetSelector-" + std::to_string((long)_target);
    case CKActionVariant::Responder:
      return std::string(sel_getName((SEL)_selectorOrIdentifier)) + "-Responder-" + std::to_string((long)_scopedResponderAndKey.responder);
    case CKActionVariant::Block:
      return "Block-" + std::to_string((long)_block);
    case CKActionVariant::BlockWithIdentifier:
      if (CKReadGlobalConfig().actionShouldUseCustomIdentifierInIdentifierString) {
        return std::string("BlockWithIdentifier-") + std::to_string((long)_scopedResponderAndKey.responder) +
            "-" + std::to_string((long)_selectorOrIdentifier);
      } else {
        return std::string("BlockWithIdentifier-") + std::to_string((long)_scopedResponderAndKey.responder) +
            "-" + std::to_string((long)_block);
      }
  }
}