11Replace ` plugin_name ` throughout this guide with the name of your plugin.
2- The example below uses ` ios ` , replace ` ios ` with ` macos ` / ` darwin ` as applicable.
2+ The example below uses ` ios ` , replace ` ios ` with ` macos ` or ` darwin ` , as applicable.
33
4- 1 . [ Turn on the Swift Package Manager feature ] [ enableSPM ] .
4+ 1 . Ensure that you are running Flutter 3.44 or later. This enables SwiftPM by default .
55
661 . Start by creating a directory under the ` ios ` , ` macos ` , and/or ` darwin `
77 directories.
@@ -73,9 +73,10 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
7373 dependencies : [],
7474 resources : [
7575 // TODO: If your plugin requires a privacy manifest
76- // (e.g. if it uses any required reason APIs), update the PrivacyInfo.xcprivacy file
76+ // (in other words, if it uses any required reason APIs),
77+ // update the PrivacyInfo.xcprivacy file
7778 // to describe your plugin's privacy impact, and then uncomment this line.
78- // For more information, see :
79+ // For more information, visit :
7980 // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
8081 // .process("PrivacyInfo.xcprivacy"),
8182
@@ -104,7 +105,7 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
104105 ],
105106 ```
106107
107- [ supported platforms ] : https://developer .apple.com /documentation/packagedescription/supportedplatform
108+ [ supported platforms ] : {{site .apple-dev}} /documentation/packagedescription/supportedplatform
108109
1091101 . Update the package, library, and target names in your ` Package.swift ` file.
110111
@@ -129,9 +130,10 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
129130 dependencies : [],
130131 resources : [
131132 // TODO: If your plugin requires a privacy manifest
132- // (e.g. if it uses any required reason APIs), update the PrivacyInfo.xcprivacy file
133+ // (for example, if it uses any required reason APIs),
134+ // update the PrivacyInfo.xcprivacy file
133135 // to describe your plugin's privacy impact, and then uncomment this line.
134- // For more information, see :
136+ // For more information, visit :
135137 // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
136138 // .process("PrivacyInfo.xcprivacy"),
137139
@@ -160,9 +162,10 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
160162 ``` swift title="Package.swift"
161163 resources: [
162164 // TODO: If your plugin requires a privacy manifest
163- // (e.g. if it uses any required reason APIs), update the PrivacyInfo.xcprivacy file
165+ // (for example, if it uses any required reason APIs),
166+ // update the PrivacyInfo.xcprivacy file
164167 // to describe your plugin's privacy impact, and then uncomment this line.
165- // For more information, see :
168+ // For more information, visit :
166169 // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
167170 [! .process (" PrivacyInfo.xcprivacy" ),! ]
168171
@@ -175,8 +178,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
1751781 . Move any resource files from ` ios/Assets ` to
176179 ` ios/plugin_name/Sources/plugin_name ` (or a subdirectory).
177180 Add the resource files to your ` Package.swift ` file, if applicable.
178- For more instructions, see
179- [ https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package ] ( https://developer .apple.com /documentation/xcode/bundling-resources-with-a-swift-package) .
181+ For more instructions, visit
182+ [ https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package ] ( {{site .apple-dev}} /documentation/xcode/bundling-resources-with-a-swift-package) .
180183
1811841 . Move any public headers from ` ios/Classes ` to
182185 ` ios/plugin_name/Sources/plugin_name/include/plugin_name ` .
@@ -292,10 +295,10 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
292295
2932961 . Update your `Package.swift ` file with any customizations you might need.
294297
295- 1 . Open the `ios/ plugin_name/ ` directory in Xcode .
298+ 1 . In Xcode, open the `ios/ plugin_name/ ` directory.
296299
297300 1 . In Xcode, open your `Package.swift ` file.
298- Verify Xcode doesn't produce any warnings or errors for this file.
301+ Verify that Xcode doesn't produce any warnings or errors for this file.
299302
300303 ::: tip
301304 If Xcode doesn't show any files, quit Xcode (** Xcode > Quit Xcode** ) and
@@ -320,7 +323,7 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
320323 ```
321324
322325 1 . Make any other customizations. For more information on how to write a
323- `Package.swift` file, see
326+ `Package.swift` file, visit
324327 [https: // developer.apple.com/documentation/packagedescription](https://developer.apple.com/documentation/packagedescription).
325328
326329 ::: tip
@@ -360,8 +363,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
360363 :::
361364
3623651 . If your `ios/ plugin_name/ Sources/ plugin_name/ include` directory only
363- contains a `.gitkeep`, you'll want update your `.gitignore` to include the
364- following:
366+ contains a `.gitkeep`, you'll want to update your `.gitignore` to
367+ include the following:
365368
366369 ```text title= " .gitignore"
367370 ! .gitkeep
@@ -442,7 +445,7 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
442445 [undo the Swift Package Manager migration][removeSPM].
443446 :::
444447
445- 1 . Open the plugin's example app in Xcode .
448+ 1 . In Xcode, open the plugin's example app.
446449 Ensure that ** Package Dependencies** shows in the left
447450 ** Project Navigator** .
448451
@@ -453,7 +456,6 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable.
453456
454457 * Follow instructions for [testing plugins][].
455458
456- [enableSPM]: / packages-and-plugins/ swift- package - manager/ for - plugin- authors#how - to- turn- on- swift- package - manager
457459[`PrivacyInfo.xcprivacy` file]: https: // developer.apple.com/documentation/bundleresources/privacy_manifest_files
458460[`public_header_files`]: https: // guides.cocoapods.org/syntax/podspec.html#public_header_files
459461[Swift Package Manager's documentation]: {{site.github }}/ apple/ swift- package - manager/ blob/ main/ Documentation/ Usage.md #creating - c- language- targets
0 commit comments