Vandelay is a Swift-based iOS importer/exporter. It supports Codable, strings and data and comes with built-in support for exporting and importing strings and data to and from a bunch of data sources.
Installation
Swift Package Manager
The easiest way to add Vandelay to your project is to use Swift Package Manager:
To add Vandelay to your app without a dependency manager, clone this repository, add Vandelay.xcodeproj to your project and Vandelay.framework as an embedded app binary and target dependency.
Exporting data
Vandelay uses exporters to let you export strings, data and Encodable.
Vandelay comes with the following built-in exporters:
EmailExporter - exports strings & data as email attachments
FileExporter - exports strings & data to local files
MessageExporter - exports strings & data as message attachments
PasteboardExporter - exports strings to the pasteboard
You can extend Vandelay with custom exporters as well.
Use string exporters if you want platform-agnostic, readable exports. Use a data exporters when you only have Data or when a type can’t be serialized.
Importing data
Vandelay uses importers to let you import strings, data and Decodable types.
Vandelay comes with the following built-in importers:
FileExporter - imports strings & data from local files
PasteboardExporter - imports strings from the pasteboard
UrlExporter - imports strings & data from custom urls
You can extend Vandelay with custom importers as well.
When importing, the same goes as when exporting: data is more powerful, but strings are more universal.
Importing external files
You can use the existing importers to import data by sharing external files to Vandelay, e.g. by tapping an e-mail attachment or sharing a file to the app.
To import files, your app must be correctly configured to handle the file type. You have to register Document types and Exported Type UTIs and implement the correct functions in AppDelegate (iOS 12 and earlier) or SceneDelegate (iOS 13+). Once the functions are triggered, you can use a UrlImporter to import the tapped file.
Check out the demo app for an example on how this can be done.
QR Code support
You can generate QR codes with the QrCodeGenerator implementations in this library. You can import data from a scanned QR code with a UrlImporter.
Demo App
This repo contains a demo app that lets you export/import todo items (strings) and photos (data). To run the demo app, open and run the Vandelay.xcodeproj project.
The demo app registers a custom file type .vdl which it uses to export and import data. Have a look at Info.plist, AppDelegate and SceneDelegate to see how it handles imports.
Contact me
Feel free to reach out if you have questions or if you want to contribute in any way:
About
Vandelay is a Swift-based iOS importer/exporter. It supports
Codable
, strings and data and comes with built-in support for exporting and importing strings and data to and from a bunch of data sources.Installation
Swift Package Manager
The easiest way to add Vandelay to your project is to use Swift Package Manager:
CocoaPods
Carthage
Manual installation
To add
Vandelay
to your app without a dependency manager, clone this repository, addVandelay.xcodeproj
to your project andVandelay.framework
as an embedded app binary and target dependency.Exporting data
Vandelay uses
exporters
to let you export strings, data andEncodable
.Vandelay comes with the following built-in exporters:
EmailExporter
- exportsstrings
&data
as email attachmentsFileExporter
- exportsstrings
&data
to local filesMessageExporter
- exportsstrings
&data
as message attachmentsPasteboardExporter
- exportsstrings
to the pasteboardYou can extend Vandelay with custom exporters as well.
Use
string
exporters if you want platform-agnostic, readable exports. Use adata
exporters when you only haveData
or when a type can’t be serialized.Importing data
Vandelay uses
importers
to let you import strings, data andDecodable
types.Vandelay comes with the following built-in importers:
FileExporter
- importsstrings
&data
from local filesPasteboardExporter
- importsstrings
from the pasteboardUrlExporter
- importsstrings
&data
from custom urlsYou can extend Vandelay with custom importers as well.
When importing, the same goes as when exporting: data is more powerful, but strings are more universal.
Importing external files
You can use the existing importers to import data by sharing external files to Vandelay, e.g. by tapping an e-mail attachment or sharing a file to the app.
To import files, your app must be correctly configured to handle the file type. You have to register
Document types
andExported Type UTIs
and implement the correct functions inAppDelegate
(iOS 12 and earlier) orSceneDelegate
(iOS 13+). Once the functions are triggered, you can use aUrlImporter
to import the tapped file.Check out the demo app for an example on how this can be done.
QR Code support
You can generate QR codes with the
QrCodeGenerator
implementations in this library. You can import data from a scanned QR code with aUrlImporter
.Demo App
This repo contains a demo app that lets you export/import todo items (strings) and photos (data). To run the demo app, open and run the
Vandelay.xcodeproj
project.The demo app registers a custom file type
.vdl
which it uses to export and import data. Have a look atInfo.plist
,AppDelegate
andSceneDelegate
to see how it handles imports.Contact me
Feel free to reach out if you have questions or if you want to contribute in any way:
License
Vandelay is available under the MIT license. See the LICENSE file for more info.