Background mode in IOS is very limited. Android 8+ seriously restricts background services also.
But, probably, you talk about some service operations which you want to execute in 'background', when app is activated.
When user simply types something, CPU usage is enough low. According my experiments on old iPhone 6s Plus, when I typed in TextView CPU usage was 25% maximum. When I stopped typing, CPU usage was about 1%.
To detect idle regime is enough simple, for example, - (void) doEvents { [self performSelector: @selector (_mysub) withObject: nil afterDelay: 0.0]; }