then somehow pass the view with the preview to the app.
There is no good way to do this using public API.
The system itself does this a lot using a technology known as remote view. For example, when your app hosts a WKWebView
, most of the work is done in a helper process and this remote view technology routes events from your app to that helper process and displays the helper process’s view such that it appears to exist in your app’s view hierarchy. Getting this to work reliably in the general case is staggeringly difficult [1] and probably not possible using public API.
There is, however, progress to be made in specific cases. For example, if your plug-ins only need to draw content that’s displayed in your main app, that’s quite feasible using IOSurface
.
So, do you have any constraints that you can apply here? Or do you really need to support everthing that AppKit supports in NSWindow
/ NSView
? ’cause I’d definitely rate the latter as Too Hard™.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] I happen to be friends with the guy who maintains this technology and he has some terrifying war stories (-: