flutter / flutter/website

Handling package interdependencies for iOS needs to be updated to SwiftPM

Open
#13,801 0 comments 0 reactions 1 assignee Claimed by @sfshaza2 View on GitHub
dev.packages e1-hours fix.code-sample from.page-issue p2-medium target.iOS
Dominant language
Dart
Stars
3.1k
Forks
3.5k
Avg merge
2d 4h
Merged PRs (30d)
95

Description

### Page URL

https://docs.flutter.dev/packages-and-plugins/developing-packages#ios

### Page source

_No response_

### Describe the problem

The documentation is currently for CocoaPods. SwiftPM is now the default.

### Expected fix

The SwiftPM instructions should say something like

The following example sets a dependency for other_plugin in my_plugin/ios/my_plugin/Package.swift:

```
let package = Package(
...
dependencies: [
.package(name: "other_plugin", path: "../other_plugin"),
...
```

You can now `import other_plugin` and access the source code at my_plugin/ios/my_plugin/Sources.

For additional details on Swift package manifests, see the [Apple's Documentation](https://developer.apple.com/documentation/packagedescription).

### Additional context

_No response_

### I would like to fix this problem.

- [ ] I will try and fix this problem on docs.flutter.dev.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.