Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

Pure Swift + ArcGIS Runtime for iOS

$
0
0
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 :)

123456
framework module ArcGIS {
umbrella header “ArcGIS.h”
export *
module * { export * }
}
1234
#!/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


Viewing all articles
Browse latest Browse all 764

Trending Articles