GBA-8-19/CGame/Importing/ImportOption.swift
bluesea 66c5202be8 s
2024-06-14 18:12:40 +08:00

31 lines
696 B
Swift

//
// ImportOption.swift
// Hthik
//
// Created by Hthik on 5/1/17.
// Copyright © 2017 Hthik. 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)
}