The protrusion of smartphone lens is a taboo in the smartphone industry rather than a trend. The protrusive lens can easily become a target for scratch as it is the primary contact point between the phone a flat surface, eg a table. Apple still feature the protrusive lens as a way to ease signal connection and looks like they have patent a new technology which will allow their camera appears flat in the future of iPhones.
The primary reason for a bulging camera module is to eliminate interference between electronic components that are too close. Particular in iPhones, the position of the rear lens is often quite close to that of many major hardware which might create interference to other hardware functionality, thus affect the general functionality of smartphones.
According to this patent document, Apple will transmit data and signals through optical modules. In order to achieve higher data transmission rates, multiple light-emitting modules and receiving sensors can work in parallel and transmit via optical module. Thus, there will be no inteference if modules are packed closer to each other.