How to disable screen Recording in iOS app

前端 未结 3 2041
抹茶落季
抹茶落季 2021-01-03 03:17

Is there any way to disable the screen recording? or is is possible through a configuration profile? or any third party library is available?

3条回答
  •  孤街浪徒
    2021-01-03 03:21

    sharedRecorder.stopRecording( handler: { previewViewController, error in    
        if let error = error {
            print("\(error.localizedDescription)")
        }
        if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad {
            previewViewController?.modalPresentationStyle = UIModalPresentationStyle.popover
            previewViewController?.popoverPresentationController?.sourceRect = CGRect.zero
            previewViewController?.popoverPresentationController?.sourceView = self.view
        }
        if previewViewController != nil {
            self.previewViewController = previewViewController
            previewViewController?.previewControllerDelegate = self
        }
        self.present(previewViewController!, animated: true, completion: nil)
        })
        return
    }
    
    
    
    https://developer.apple.com/documentation/replaykit/rpscreenrecorder/1620990-stoprecording
    

提交回复
热议问题