Last active
December 11, 2018 09:59
-
-
Save Oni-zerone/08c250b3a97bf15ee2e6d3b1fb55725f to your computer and use it in GitHub Desktop.
The InteractionDelegate bridge to AbstractFactory
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 typealias InteractionFactory = InteractionDelegate & AbstractFactory | |
public extension InteractionDelegate where Self: AbstractFactory { | |
func containerView(_ containerView: UIView, shouldSelect item: ItemViewModel) -> Bool { | |
return item is BuilderContainer | |
} | |
func containerView(_ containerView: UIView, didSelect item: ItemViewModel) { | |
guard let builderContainer = item as? BuilderContainer, | |
let builder = self.getBuilder(from: container), | |
let viewController = self.make(from: builder) else { | |
return | |
} | |
self.presenterViewController?.show(viewController, sender: sender) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment