Add Simple Template Example

- Add a simple Template example that shows a user profile with avatar, displayName and presence.
- ScreenCoordinator: closure based with less protocols and delegates.
- Reducer: Reducer function that manages all state modifications.
- SwiftUI View: Decomposes UI into appropriate sub components.
- Uses Theme and Dependency Management Infrastructure
This commit is contained in:
David Langley
2021-09-06 17:12:31 +01:00
parent 3421f8f0e4
commit 17c6ce6a10
18 changed files with 438 additions and 31 deletions
@@ -27,12 +27,21 @@ class VectorHostingController: UIHostingController<AnyView> {
// MARK: Private
private var theme: Theme
init() {
self.theme = ThemeService.shared().theme
super.init(rootView: AnyView(EmptyView()))
}
init<Content>(rootView: Content) where Content: View {
self.theme = ThemeService.shared().theme
super.init(rootView: AnyView(rootView.vectorContent()))
}
func setRoot<V: View>(view: V) {
rootView = AnyView(view)
}
required init?(coder aDecoder: NSCoder) {
fatalError("VectorHostingViewController does not currently support init from nibs")
}