Apple's iPhone is 2nd in the world for smartphone sales by brand unit sales, second only to Samsung, but it is 1st in the world in the mid to high end market (since Samsung's numbers include lots of crappy low end models). iPhone is also 1st in the world in terms of profits. In fact, it's been claimed that iPhone profit is higher than all other smartphone profits combined.
It's a relatively close race even for unit sales though, since in some quarters in recent years, Apple has outsold Samsung by unit volume too (even despite Samsung's sales of lots of crappy low end models). This typically happens in Q4 just after new iPhones have been released.