feat: ✨ Add iOS Swift Package Manager support - #507
Open
47gurvinder wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restructures the iOS plugin implementation to support Swift Package Manager (SPM) by moving iOS sources into a SwiftPM-compatible layout and updating the plugin entrypoint accordingly.
Changes:
- Removed the Objective-C wrapper plugin entrypoint and renamed the Swift plugin class to
AudioWaveformsPlugin. - Added new iOS Swift sources (
Utils.swift,RecordingSettings.swift) and updated several files to import Flutter types directly. - Introduced an iOS
Package.swiftand updated the iOS podspec (including raising the iOS minimum to 13.0) plus a changelog entry.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ios/Classes/AudioWaveformsPlugin.m | Removed Objective-C wrapper entrypoint. |
| ios/Classes/AudioWaveformsPlugin.h | Removed Objective-C wrapper header. |
| ios/audio_waveforms/Sources/audio_waveforms/WaveformExtractor.swift | Adds Flutter import for channel/result types. |
| ios/audio_waveforms/Sources/audio_waveforms/Utils.swift | Adds shared constants/types/utilities for the new iOS Swift source layout. |
| ios/audio_waveforms/Sources/audio_waveforms/RecordingSettings.swift | Adds a settings model + JSON parsing for recorder configuration. |
| ios/audio_waveforms/Sources/audio_waveforms/RecorderBytesStreamEngine.swift | Adds Flutter import for typed-data/channel integration. |
| ios/audio_waveforms/Sources/audio_waveforms/AudioWaveformsPlugin.swift | Renames Swift plugin class to AudioWaveformsPlugin and updates registration. |
| ios/audio_waveforms/Sources/audio_waveforms/AudioRecorder.swift | Adds Flutter import for channel/result/error usage. |
| ios/audio_waveforms/Sources/audio_waveforms/AudioPlayer.swift | Adds Flutter import and updates plugin type reference after rename. |
| ios/audio_waveforms/Package.swift | Adds SwiftPM manifest for iOS package distribution. |
| ios/audio_waveforms.podspec | Points CocoaPods to the new Swift source layout and updates iOS platform to 13.0. |
| CHANGELOG.md | Notes the addition of iOS SPM support. |
Comments suppressed due to low confidence (1)
ios/audio_waveforms/Sources/audio_waveforms/AudioPlayer.swift:20
AudioWaveformsPluginholds strong references toAudioPlayerinstances (audioPlayersdictionary), andAudioPlayerholds a strong reference back to the plugin (var plugin: AudioWaveformsPlugin). This creates a retain cycle, so players/plugins may never be deallocated (especially if callers forget to explicitly release players). Consider removing the back-reference entirely (use the existingflutterChannelproperty) or making the plugin referenceweakand adjusting call sites accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+22
| dependencies: [ | ||
| .package(name: "FlutterFramework", path: "../FlutterFramework") | ||
| ], | ||
| targets: [ | ||
| .target( | ||
| name: "audio_waveforms", | ||
| dependencies: [ | ||
| .product(name: "FlutterFramework", package: "FlutterFramework") | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues