sounds icon indicating copy to clipboard operation
sounds copied to clipboard

Convert objective-c code to swift

Open bsutton opened this issue 4 years ago • 4 comments

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.

bsutton avatar Sep 24 '20 00:09 bsutton

@gaaclarke

bsutton avatar Sep 24 '20 01:09 bsutton

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.

gaaclarke avatar Sep 24 '20 02:09 gaaclarke

Thanks for the link. That should be helpful.

bsutton avatar Sep 24 '20 23:09 bsutton

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

bsutton avatar Nov 10 '20 20:11 bsutton