Search code examples
iosobjective-ccomponentkit

CKComponent handle tap gesture


Is it possible to have an CKComponent without an view to handle a tap gesture?

I just found this solution WITH a view:

...

+ (instancetype)newWithViewModel:(NewsComponentViewModel *)viewModel
{
    CKComponent *comp = ...;
    return [super
            newWithView:{
                [UIView class],
                {CKComponentTapGestureAttribute(@selector(didTapView))}
            }
            component:comp];
}

Solution

  • @itsthejb is correct. You must have a view to handle actions.