Skip to content

Instantly share code, notes, and snippets.

@nixta nixta/ArcGIS With Swift.md Secret
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.