Assuming if it is for 2x2 emergency recessed light with battery backup then would it not have to be on all the time or not per building code or other codes?
Egress lighting requirements are for when occupied thus if unoccupied you don't require lighting. As opposed to requirements for emergency egress lighting and exit marking lights that will remain lit or will light regardless of occupancy. If power was to go out even if switched off lighting will illuminate from the battery backup on emergency egress light. A lot of these at a reduced lumen vs full lumen as when fixture is on (ie. 2 of 4 led tubes).
Another consideration sometimes are made for large spaces to allow for minimum full time lighting (unswitched) for incidental turning off of lights and a large office space (multiple occupancy) still occupied to prevent total darkness. Sometimes will use the emergency light (or section of fixture) to be perminant power (unswitched) for this reason.
One example that might help visualize the supply wiring for the switched fixture:
For simplification of illustration utilizing 14/3 NM.
Branch feed into switch location 14/2
Bk from 14/2 splice one feed to Sw and another to Rd of 14/3
Bk of 14/3 to other Sw terminal
Wh of 14/2 simply splice to Wh of 14/3
Then at fixture Rd of 14/3 to emergency driver, Bk of 14/3 to LED driver, Wh to both drivers.
Now you have light functioning from the switch and will still act via Emergency driver in event of outage.
A review of minimum egress lumens would be required to determine the number of these units or split units would be required vs total desired lumens for full illumination.