Skip to content

Instantly share code, notes, and snippets.

@nixta
Last active August 29, 2015 14:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nixta/b922ba0690c78b4ca48f to your computer and use it in GitHub Desktop.
Save nixta/b922ba0690c78b4ca48f to your computer and use it in GitHub Desktop.
Add the appropriate module.moduledef file to the ArcGIS Runtime SDK for iOS to allow it to work as an Import for Swift.

Pure Swift + ArcGIS Runtime for iOS

To avoid using a bridging header (e.g. if you have a swift-only project), you must first set up the ArcGIS Framework to declare a Module for itself.

Create a Modules/module.modulemap file in the ArcGIS Runtime SDK for iOS ArcGIS.framework (usually installed at ~/Library/SDKs/ArcGIS/iOS/ArcGIS.framework). You will then be able to use the ArcGIS Runtime SDK for iOS in a Swift-only project.

Any .swift file that makes use of the framework will need an import ArcGIS statement.

Either run the bash script, or manually create the file with the contents of module.modulemap from this Gist.

Note: Despite this coming from Apple, as with all things Swift at this time, this is entirely unsupported by Esri :)

framework module ArcGIS {
umbrella header "ArcGIS.h"
export *
module * { export * }
}
#!/bin/bash
mkdir -p ~/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/Modules/
echo ZnJhbWV3b3JrIG1vZHVsZSBBcmNHSVMgewogIHVtYnJlbGxhIGhlYWRlciAiQXJjR0lTLmgiCgogIGV4cG9ydCAqCiAgbW9kdWxlICogeyBleHBvcnQgKiB9Cn0K | base64 -D -o ~/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/Modules/module.modulemap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment