Apple CEO Tim Cook said he felt it was necessary to "engage" when Trump invited him and about a dozen tech executives to attend a summit.