USB Restricted Mode within iOS
With iOS 11.4.1, a feature called USB Restricted Mode was included. This option adds protections against the USB devices being used by law enforcement and private companies that connect over Lightning to crack an iPhone’s passcode.
Go to Settings and Face ID (or Touch ID) & Passcode. Verify that USB Accessories option is disabled. The switch should be off by default. Once an iPhone or iPad has been locked for over an hour straight, iOS will no longer allow USB accessories to connect to the device.