mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 08:10:59 +00:00
32 lines
968 B
Swift
32 lines
968 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Combine
|
|
import ServiceLayer
|
|
import SwiftUI
|
|
import ViewModels
|
|
|
|
@objc(ShareExtensionNavigationViewController)
|
|
class ShareExtensionNavigationViewController: UINavigationController {
|
|
private let viewModel = ShareExtensionNavigationViewModel(
|
|
environment: .live(
|
|
userNotificationCenter: .current(),
|
|
reduceMotion: { UIAccessibility.isReduceMotionEnabled }))
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
let newStatusViewModel: NewStatusViewModel
|
|
|
|
do {
|
|
newStatusViewModel = try viewModel.newStatusViewModel(extensionContext: extensionContext)
|
|
} catch {
|
|
setViewControllers([ShareErrorViewController(error: error)], animated: false)
|
|
|
|
return
|
|
}
|
|
|
|
setViewControllers(
|
|
[UIHostingController(rootView: NewStatusView { newStatusViewModel })],
|
|
animated: false)
|
|
}
|
|
}
|