Twilio chat iOS library fully stubbed for SPM integrations.
In order to be able to run tests also on Linux systems, we abstract Swift code in SPMs as much as possible, that can be used by our iOS applications. The iOS application will have the real Twilio dependency (via Cocoapods), and the tests are run isolated in the Twilio Chat SPM package, which loads this SPM dependency.
Objective-C bridges and umbrella headers did not work as expected in this kind of integration, therefore we decided to transform those headers into swift files without implementing any logic and stubbing function returns.
Versions are linked via git tags.
Dependencies are transformed into Swift 5.0 files from Twilio's Carthage headers.
Twilio defines a Carthage dependency though, that can be set up in Xcode with a few hacks, following the using Swift package manager with Carthage guide.
In order to generate the dependency binaries that this project uses to create the Swift files, carthage needs to be installed.
brew install carthage
Then, checkout the Twilio repository
carthage update
Now, a Carthage
folder should have been created (that won't be pushed to the repository), with a Checkouts
subfolder.
To generate the TwilioChatClient
real binaries:
carthage build
This will have generated a Builds
subfolder.
You can now check the Objective C headers for the Twilio library in Carthage/Builds/iOS/TwilioChatClient.framework/Headers
.
link |
Stars: 1 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics