Join us from October 8-10 in New York City to learn the latest tips, trends, and news about GraphQL Federation and API platform engineering.Join us for GraphQL Summit 2024 in NYC
Docs
Start for Free

Using Apollo as an XCFramework


If you need to use and the code generation output as an XCFramework, this page will give a high level overview of how to do so, as well as collect some tips on things you may encounter that have been reported by the community.

Creating the XCFramework

Apollo iOS

In order to use Apollo iOS as an XCFramework, we provide a apollo-ios-xcframework repository that can generate XCFrameworks from the Apollo iOS code including the necessary commands. This can be used as is or as a starting point for you to customize further for your needs.

Code Generation Output

You can also use the output from code generation as an XCFramework, you will need to configure this setup yourself. You can use the code generation test project as an example/starting point for this.

Tips

Enum @unknown case

For enums in Apollo iOS and code generation output, you should implement the @unknown case anywhere you are using the enumerations. For more information on @unknown see the Swift Docs.

Custom Scalars

If you have custom that are type Foundation types, you will need to do an @_exported import Foundation in order to prevent a Swift warning which will become an error in Swift 6.

Previous
Test Mocks
Next
File Uploads
Rate articleRateEdit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc., d/b/a Apollo GraphQL.

Privacy Policy

Company