Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 795 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 795 Bytes

ExportKit

A simple package to save and export data in the app. The package also includes simple views to list all saved data and export them using the ShareSheet.

Setup

To export data, ExportKit needs an exportStrategy which need to be defined before exporting the data. For UIKit apps you can set the strategy in the App Delegate, SwiftUI apps can make use root view (where :App is defiend).

ExportKit.shared.exportStrategy = { item in
    guard let item = item else { 
        return .failure(ExportKitError.itemNotFound) 
    }
    
    *** DO SOMETHING WITH THE ITEM *** 
    
    return .success(DATA_TO_BE_SHARED)
}