Created
April 8, 2019 13:45
-
-
Save dangthaison91/3ff0aa57ad635c6417f45ca9a15aace7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
public protocol ScannerPlugin { | |
var id: String { get } | |
var symbol: Barcode.Format { get } | |
func isApplicable(for code: Barcode) -> Observable<Bool> | |
func build(withCode code: Barcode, listener: ScannerPluginListener) -> ViewableRouting | |
} | |
public protocol ScannerPluginListener: class { | |
} | |
public class ScannerPluginPoint { | |
private var plugins: [ScannerPlugin] = [] | |
private var applicablePlugins: [String: ScannerPlugin] = [:] | |
private init() {} | |
func createApplicableRIBs(code: Barcode, listener: ScannerPluginListener) -> Observable<[String: ViewableRouting]> { | |
// loop plugins and build child routers | |
} | |
} | |
// Plugin | |
protocol PluginAListener { | |
} | |
final class PluginAInteractor: PresentableInteractor<PluginAPresentable>, PluginAInteractable, PluginAPresentableListener { | |
weak var router: PluginARouting? | |
weak var listener: ScannerPluginListener? //PluginAListener | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment