mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-28 04:06:57 +02:00
get rid of additional UIHostingController. Cleanup and comments.
This commit is contained in:
+21
-8
@@ -16,12 +16,33 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: View model
|
||||
|
||||
enum ComposerCreateActionListViewModelResult: Equatable {
|
||||
// The user selected an action
|
||||
case done(ComposerCreateAction)
|
||||
}
|
||||
|
||||
// MARK: View
|
||||
|
||||
struct ComposerCreateActionListViewState: BindableState {
|
||||
|
||||
/// The list of composer create actions to display to the user
|
||||
let actions: [ComposerCreateAction]
|
||||
}
|
||||
|
||||
@objc enum ComposerCreateAction: Int {
|
||||
/// Upload a photo/video from the media library
|
||||
case photoLibrary
|
||||
/// Add a sticker
|
||||
case stickers
|
||||
/// Upload an attachment
|
||||
case attachments
|
||||
/// Create a Poll
|
||||
case polls
|
||||
/// Add a location
|
||||
case location
|
||||
/// Upload a photo or video from the camera
|
||||
case camera
|
||||
}
|
||||
|
||||
@@ -64,11 +85,3 @@ extension ComposerCreateAction {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ComposerCreateActionListViewState: BindableState {
|
||||
let actions: [ComposerCreateAction]
|
||||
}
|
||||
|
||||
enum ComposerCreateActionListViewModelResult: Equatable {
|
||||
case done(ComposerCreateAction)
|
||||
}
|
||||
|
||||
@@ -17,8 +17,15 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ComposerCreateActionList: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@ObservedObject var viewModel: ComposerCreateActionListViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
|
||||
-1
@@ -32,7 +32,6 @@ class ComposerCreateActionListViewModel: ComposerCreateActionListViewModelType,
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
|
||||
override func process(viewAction: ComposerCreateActionListViewAction) {
|
||||
switch viewAction {
|
||||
case .selectAction(let action):
|
||||
|
||||
Reference in New Issue
Block a user