your way is very straightforward, but can be very perfomance intensive in cases of big levels.
i know couple of ways to optimize it a bit.
for example in case of tilemaps from flixel engine they don’t check againist every tile in tilemap, checks are being made only for those tiles which are in the viscinity of object they could collide with. This optimization is possible due to the fact that tiles in tilemap are placed in grid order (with the step equal to tile size), so you can easily find out which tiles to check againist.
the second way might be to divide your level in several separate tilemaps with the size of the game screen, so then you could check collision againist only those tilemaps that are displayed on screen. Plus you could make invisible (or remove from the scene completely) those tilemap chunks which are not visible on screen. This way you could save up some perfomance on rendering (but i’m not sure about it, this should be tested).
But there is no one universal “right” way to do platformer, every game could achieve its results in different ways, some of them could even ignore any optimization (due to small game world, or other factors). First, you should assemble a prototype of the game level and see how it performs, what are the most critical places which need to be optimized, and only then think how you could do it. Maybe you won’t need to use those optimizations at all