Skip to content

Convert objective-c code to swift #47

Open

Description

@bsutton

sounds_swift.tar.gz

The current ios implementation is written in objective-c.

This is a language that the current dev team is not familiar with which makes maintenance difficult.

The dev team is also not familiar with swift however it is much closer to java and dart which the developers are familiar with.

The belief is that converting the code to swift will make long term maintenance simpler.

An initial conversion has been down using swiftify (converted files attache).

The converted files however need a fair bit of work (primarily around type conversions).

The sounds team have two related objectives:

Move to using Pigeon to provide a type safe implementation.

Move to a federated model to allow for the implementation of platform specific implementation by third party developers.

The swift migration should be done in the context of the above two objectives.

The aim is to do the android version first is this is in an environment that the development team is comfortable.
Once complete the swift migration would follow.

Works has been started to complete the conversion process (see master) (based on the attached swift files) but this conversion is likely to have broken the code base as the developer is not familiar with swift.

Activity

  1. added
    enhancement
    on Sep 24, 2020
  2. bsutton commented on Sep 24, 2020

    @bsutton
    OwnerAuthor
  3. gaaclarke commented on Sep 24, 2020

    @gaaclarke

    Hey @bsutton, I have an example of using pigeon with Swift (https://github.com/gaaclarke/GiantsA2A). It shouldn't be a problem, Swift interacts well with objc and steps were taken to make sure things like null safety were correct. You shouldn't have to convert any of the files. If you are writing a plugin I plan on supplying a sample project for that which will be more apropos soon.

  4. bsutton commented on Sep 24, 2020

    @bsutton
    OwnerAuthor

    Thanks for the link. That should be helpful.

  5. bsutton commented on Nov 10, 2020

    @bsutton
    OwnerAuthor

    We have now made the decision to move to ffi which should result in the removal of almost all native code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions