[macOS] Add platform view documentation
This adds documentation on authoring and using platform views for Flutter apps targeting macOS.
The initial version of this documentation is Swift-only, but a follow-up will add Objective-C example code.
Fixes: #9424
Presubmit checklist
- [X] This PR is marked as draft with an explanation if not meant to land until a future stable release.
- [X] This PR doesn’t contain automatically generated corrections (Grammarly or similar).
- [X] This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn’t use i.e. or e.g., and it avoids I and we (first person).
- [X] This PR uses semantic line breaks of 80 characters or fewer.
Visit the preview URL for this PR (updated for commit bd8c6aabbcd71322db42a28764f3ebf77689c6af):
https://flutter-docs-prod--pr10796-macos-platformview-docs-hj2iqzhf.web.app
Does this fix https://github.com/flutter/website/issues/9424?
@atsansone yes, this will fix that bug; added to the description -- thanks!
The initial version of this documentation is Swift-only, but a follow-up will add Objective-C example code.
Technically we've never supported Obj-C as a language for macOS. In practice it works because of interop of course, but we haven't traditionally done documentation or examples in anything but Swift.
Technically we've never supported Obj-C as a language for macOS.
Thanks. Was thinking it might be handy just in case people had some existing Obj-C NSViews they'd like to wrap but you're entirely right: we don't even have an Obj-C template for macOS, and people in that boat can just expose their own Swift-friendly header to the plugin. Not only that, but publishing Obj-C source implies that we're willing to commit to supporting that use-case and we aren't in a position to do so.
Removed the tabs and sending this out as Swift-only.
Alright; this is ready for a proper review.
Does this need any version note or similar clarification?
@cbracken, are these docs valid for the current stable release? If not, I can add a note at the top stating that fact.
@loic-sharma, do you know if this info is valid as of now, or if it's valid after the next release? Before I land it, I want to be clear. If it's for the next release, I can still land it, but will first add a note.
@sfshaza2 In general we don't want to tell people to use macOS platform views until after the next stable release (due to critical missing functionality like gesture support).