add below observer to detect screen share start stop
NotificationCenter.default.addObserver(forName: UIScreen.capturedDidChangeNotification, object: UIScreen.main, queue: OperationQueue.main) { (notification) in}
Topic:
App & System Services
SubTopic:
Core OS
Tags: