Apple nearly catches Samsung as smartphone sales soar