This file serves as a reference for contributing to the NotPrivateAPIs DocC bundle. When creating new documentation articles, please adhere to the following conventions.
- Framework Directories: Group articles inside directories corresponding to the Apple framework they belong to (e.g.,
UIKit,SwiftUI,NSObject). - Topic Separation:
- Create a primary Markdown file for the main class or structure (e.g.,
UIAlertController/UIAlertController.md). - Create separate Markdown files for each specific method, initializer, or property within the same directory (e.g.,
UIAlertController/_setHeaderContentViewController.md).
- Create a primary Markdown file for the main class or structure (e.g.,
- Linking: The primary class/struct file must include a
## Topicssection linking to its child pages using the<doc:FileName>syntax.## Topics - <doc:_setHeaderContentViewController>
- Title: Begin with an H1 (
#) matching the exact API name (e.g.,# _setHeaderContentViewController(_:)). - Metadata: Include a
@Metadatablock immediately after the title specifying:@TitleHeading("Type")where "Type" is "Class", "Structure", "Instance Method", "Initializer", etc.@Availabletags to specify OS availability if known.@PageColor(colorName)based on the following correlation with@TitleHeading:- blue:
Class,Structure - red:
Instance Method,Initializer,Technology Overview - green:
Instance Property - orange:
Protocol - purple:
Tool
- blue:
@Metadata { @TitleHeading("Instance Method") @Available(iOS, introduced: "8.0") @PageColor(red) }
- Short Description: Provide a brief, one-line summary directly below the
@Metadatablock. - Overview: A
## Overviewsection detailing the API's purpose, background, and typical usage. - Warnings: For private/internal APIs, include a GitHub-style blockquote warning such as:
> Warning: It is unknown when [API] was added... Testing is required...> Warning: It is unknown when `_setHeaderContentViewController(_:)` was added to `UIAlertController` and exactly which operating systems/versions support it. Testing is required before release into production and `_setHeaderContentViewController(_:)` may be removed in the future. - Sections: Depending on the API, include
## Method,## Parameters, or equivalent sections. - Examples: A
## Examplesection featuring a complete, compilable Swift code snippet (such as a fullUIViewControlleror SwiftUIContentView). - Credits: A
## Creditssection linking to the researcher/developer who discovered the private API on X/Twitter or other social media platforms.## Credits - [Developer Name](https://x.com/username)
- Formatting: Use standard Markdown syntax for images and videos:
. - Placement: Place graphical examples inline directly within the
## Overviewsection to visually demonstrate what the API does.