The prices were an indication that Apple was ready to swallow the cost of tariffs to ward off competition from Samsung, Alphabet’s Google and domestic rivals in China, even as it has predicted that the levies would cost it more than $1 billion in the current fiscal quarter