To some reasons, our APP dont't want people record screen, but in ios11 a new feature can let user record there iphone screen, so is there an API or notification indicate me user is recording now thank u very much
Asked
Active
Viewed 3,788 times
4
-
You can't completely prevent this. Even if Apple allowed disabling recording, jailbroken phones could probably get around it, and at the end of the day, recording the screen with a camera is always possible. – Carcigenicate Jul 30 '17 at 16:27
-
I do not consider jailbreak now, do you know ios11 have such an API? – Wong Sam Jul 30 '17 at 16:30
-
No. It's been a long time since I've dealt with Apple. – Carcigenicate Jul 30 '17 at 16:31
2 Answers
7
You can detect if the screen is being recorded with:
UIScreen.main.isCaptured
// True if this screen is being captured (e.g. recorded, AirPlayed, mirrored, etc.)
You can't prevent it using project settings, but you could use a modal or something to request the user to disable it. Not sure how that might workout with your AppStore submission.

nathan
- 9,329
- 4
- 37
- 51
-
This is not only screen capture but also mirroring with airplay. So not the exact solution. – birdcage Sep 14 '17 at 12:03
-
-
It's worth noting that I have seen this value return an incorrect result multiple times in testing. Frequently, we encounter a bug where the we *are* using screen recording but isCaptured returns false. – FateNuller Sep 29 '17 at 15:05
-
1
-
@WongSam if this is the correct answer that solves your problem, don't forget to accept it (green tick is) ;) – Ahmad F Apr 26 '18 at 06:47
-
if UIScreen.main.isCaptured is true, then How to Stop that record? I have start screen record, by pressing RECORD button from CONTROL CENTER, then immediately, if I open my app, then I have to STOP that record programmatically. – McDonal_11 Apr 09 '19 at 17:36
0
You can use kvo observe UIScreenCapturedDidChangeNotification
in iOS 11 like this
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
[[NSNotificationCenter defaultCenter] addObserverForName:UIScreenCapturedDidChangeNotification object:nil queue:mainQueue usingBlock:^(NSNotification * _Nonnull note) {
//code you want execute
}];