Skip to content

[google_maps_flutter] Convert remaining code to Swift - #12768

Open
stuartmorgan-g wants to merge 14 commits into
flutter:mainfrom
stuartmorgan-g:maps-swift-final
Open

[google_maps_flutter] Convert remaining code to Swift#12768
stuartmorgan-g wants to merge 14 commits into
flutter:mainfrom
stuartmorgan-g:maps-swift-final

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Converts remaining code to Swift:

  • Converts the protocols defined for testability to Swift
    • Where possible, replaces manual passthrough classes with extensions that add protocol conformance to the actual class, reducing the amount of untestable code we need.
  • Switches Pigeon generation to Swift (which causes a lot of mechanical changes due to classes no longer having a prefix, and the constructors being standard Swift construction instead of bridging to Obj-C convenience constructors)
  • Uses Pigeon's Swift generator support for subclassing to replace the somewhat hacky nested classes in the interface definition with the actual subclassing that we wanted to express, simplifying some code and adding more type safety.
  • Scrubs NSObject conformance from cases where it's no longer necessary. (Class that implement Flutter plugin API protocols still need it, as those are Obj-C protocols.)

Unlike the other PRs, this does not contain any Gemini Obj-C -> Swift conversions (other than some simple protocols); this is mostly just a Pigeon generation change and a lot of mostly mechanical cleanup.

Fixes flutter/flutter#119108

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request converts the remaining Objective-C code to Swift for both the google_maps_flutter_ios_sdk9 and google_maps_flutter_ios_sdk10 packages. This includes updating the Pigeon configuration to generate Swift code, removing Objective-C files, and refactoring Swift implementation and test files to use the new Swift-generated Pigeon APIs. Two minor typos were identified in the changelog files.

Comment thread packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md Outdated
Comment thread packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_maps_flutter] iOS Swift migration

1 participant