Device API for MDM status

Hello, Not sure how to ask, but I would like to query an iOS device using Swift to see if the device is enrolled in our mdm. I could query the MDM but I want check the device as well.

Device API for MDM status
 
 
Q