GBA001/Delta/Importing/ImportOption.swift
2018-11-12 14:51:29 -08:00

31 lines
708 B
Swift

//
// ImportOption.swift
// Delta
//
// Created by Riley Testut on 5/1/17.
// Copyright © 2017 Riley Testut. All rights reserved.
//
import UIKit
import DeltaCore
extension UIAlertController
{
func add(_ importOption: ImportOption, completionHandler: @escaping (Set<URL>?) -> Void)
{
let action = UIAlertAction(title: importOption.title, style: .default, handler: { action in
importOption.import(withCompletionHandler: completionHandler)
})
self.addAction(action)
}
}
protocol ImportOption
{
var title: String { get }
var image: UIImage? { get }
func `import`(withCompletionHandler completionHandler: @escaping (Set<URL>?) -> Void)
}