skip to Main Content
+971 55 881 1725 hmimthiaz @ imthi.com

UIScreen Notifications for connecting external display in iOS

UIScreen class has three main notifications which gets triggered when a new screen (external display) is attached to the device.

UIScreenDidConnectNotification

This notification is posted when a new screen is connected to the device. The object of the notification is the UIScreen object representing the new screen. There is no userInfo dictionary. Connection notifications are not sent for screens that are already present when the application is launched. The application can instead use the screens method to get the current set of screens at launch time.

UIScreenDidDisconnectNotification

This notification is posted when a screen is disconnected from the device. The object of the notification is the UIScreen object that represented the now disconnected screen. There is no userInfo dictionary.

UIScreenModeDidChangeNotification

This notification is posted when the current mode of a screen changes. The object of the notification is the UIScreen object whose currentMode property changed. There is no userInfo dictionary. Clients can use this notification to detect changes in the screen resolution.

Simple code to listen to the notification

If anyone is interested in screen mirroring in iPhone / iPad check this UIScreen Additions.

Back To Top