I want my application to act differently when the phone is docked or otherwise connected to the computer. Is it possible?
I could not find anything due to the fact that it is docked, but if you look at the UIDevice class , you will find the batteryState property. If you enable battery monitoring in your application, you can check if the UIDeviceBatteryStateUnplugged property is UIDeviceBatteryStateUnplugged , meaning that the device is not docked. If it is a different value ( UIDeviceBatteryStateCharging or UIDeviceBatteryStateFull ), the phone is connected to a power source.
batteryState
UIDeviceBatteryStateUnplugged
UIDeviceBatteryStateCharging
UIDeviceBatteryStateFull
Note. This does not guarantee a computer on the other end; It can also be easily wall mounted power adapter or other USB powered device.
You can also control accessory connection changes by using the EAAccessoryManager registerForLocalNotifications ' class method and adding an observer for notifications EAAccessoryDidConnectNotification , EAAccessoryDidDisconnectNotification . see apple docs EAAccessoryManager for more information