Take reference from the prototype implementation: https://github.com/himanshunaidu/iOSSurfaceIntegrityChecker