amplitude / experiment-ios-client

MIT License
2 stars 9 forks source link

Add support for BUILD_LIBRARY_FOR_DISTRIBUTION=YES #55

Open mikehouse opened 4 months ago

mikehouse commented 4 months ago

Hi. We've built the library with one version of swift compiler (Xcode 15.1/15.2) using BUILD_LIBRARY_FOR_DISTRIBUTION=YES and linked the library to a project that uses Xcode 15.3. After adding the library the project cannot be compiled anymore. The reason is names collision because of Swift compiler bug https://github.com/apple/swift/issues/56573. We fixed it by modifying private.swiftinterface file after it being built. Xcode shows such error when open the project experiment-ios-client

Public class 'Experiment.Experiment' shadows module 'Experiment', which may cause failures when importing 'Experiment' or its clients in some configurations; please rename either the class 'Experiment.Experiment' or the module 'Experiment', or see https://github.com/apple/swift/issues/56573 for workarounds