How to enable IOSurfaceRef

I am trying to build an application using private APIs to take screenshots from the background. I found this example: Taking Screenshots in the Background (iOS) - Improving Performance

In the author's code, the first line uses the IOSurfaceRef type. Can anyone explain to me how to include this in my code? I tried linking IOSurfaceAPI.h (where I defined IOSurfaceRef), however it didn't work.

+3


source to share


1 answer


First, let's start with how to link Frameworks

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ MacOSX10.11.sdk /System/Library/Frameworks/IOSurface.framework/Versions/A/Headers

  1. go to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/IOSurface.framework and create a folder called Headers


replace iPhoneOS.platform with iPhoneSimulator.platform , paste the headers into the simulator SDK folder if you want to try apps on the simulator

  1. insert all files inside

You can now use the IOSurface Framework

+2


source







All Articles