Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect whether personal wifi hotspot or recording is undergoing on iOS?

Since the red/blue glowing banner will block quite a lot of the interface. http://d.pr/SfgW

like image 258
overboming Avatar asked Dec 02 '22 01:12

overboming


2 Answers

This gives you the height of the status bar:

CGFloat statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;

With Personal Hotspot enabled, it returns 40, and returns 20 otherwise.

like image 60
Guillaume Boudreau Avatar answered Mar 17 '23 12:03

Guillaume Boudreau


The statusbar height is 40 even when you have an active call by pressing the home button durring a phone call, therefore you can not determine whether or not the personal hotspot is on.

like image 34
Gh Florin Avatar answered Mar 17 '23 11:03

Gh Florin