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
class SwiftUIAdapter<Content> where Content : View { | |
private(set) var view: Content! | |
weak private(set) var parent: UIViewController! | |
private(set) var uiView : WrappedView | |
var hostingController: UIHostingController<Content> | |
init(view: Content, parent: UIViewController) { | |
self.view = view | |
self.parent = parent |
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
const flatten = arr => arr.reduce( | |
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), [] | |
); | |
flatten([[1, 2, [3]], 4]); |