Skip to content

feat: ✨ Add iOS Swift Package Manager support - #507

Open
47gurvinder wants to merge 1 commit into
SimformSolutionsPvtLtd:mainfrom
47gurvinder:codex/ios-swift-package-manager
Open

feat: ✨ Add iOS Swift Package Manager support#507
47gurvinder wants to merge 1 commit into
SimformSolutionsPvtLtd:mainfrom
47gurvinder:codex/ios-swift-package-manager

Conversation

@47gurvinder

Copy link
Copy Markdown

Description

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Copilot AI review requested due to automatic review settings July 30, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.swift and 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

  • AudioWaveformsPlugin holds strong references to AudioPlayer instances (audioPlayers dictionary), and AudioPlayer holds 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 existing flutterChannel property) or making the plugin reference weak and 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")
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants