I want to block screen recording or video output per my app using QuickTime Player.
I had detected hdmi output and airplay with UIScreen
.
But QuickTime Play
With iOS 11 you can use the notification
NSNotification.Name.UIScreenCapturedDidChange
on AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
NotificationCenter.default.addObserver(self, selector: #selector(checkIFScreenIsCapture), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil) ......
use selector
func checkIFScreenIsCapture(notification:Notification){
guard let screen = notification.object as? UIScreen else { return }
if screen.isCaptured == true {
}else{
}
}