2021-04-28 09:02:34 +02:00
|
|
|
//
|
|
|
|
// MediaPreviewImageViewModel.swift
|
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by MainasuK Cirno on 2021-4-28.
|
|
|
|
//
|
|
|
|
|
2021-04-30 13:28:06 +02:00
|
|
|
import os.log
|
2021-04-28 09:02:34 +02:00
|
|
|
import UIKit
|
|
|
|
import Combine
|
2021-07-21 13:45:24 +02:00
|
|
|
import Alamofire
|
|
|
|
import AlamofireImage
|
|
|
|
import FLAnimatedImage
|
2022-10-08 07:43:06 +02:00
|
|
|
import MastodonCore
|
2021-04-28 09:02:34 +02:00
|
|
|
|
|
|
|
class MediaPreviewImageViewModel {
|
2021-07-02 13:48:56 +02:00
|
|
|
|
|
|
|
var disposeBag = Set<AnyCancellable>()
|
2021-04-28 09:02:34 +02:00
|
|
|
|
|
|
|
// input
|
2022-01-27 14:23:39 +01:00
|
|
|
let context: AppContext
|
2021-04-28 09:02:34 +02:00
|
|
|
let item: ImagePreviewItem
|
2021-04-30 13:28:06 +02:00
|
|
|
|
2022-01-27 14:23:39 +01:00
|
|
|
init(context: AppContext, item: ImagePreviewItem) {
|
|
|
|
self.context = context
|
|
|
|
self.item = item
|
2021-04-28 09:02:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
extension MediaPreviewImageViewModel {
|
2022-01-27 14:23:39 +01:00
|
|
|
|
2022-11-26 15:38:14 +01:00
|
|
|
public struct ImagePreviewItem {
|
2022-01-27 14:23:39 +01:00
|
|
|
let assetURL: URL?
|
2021-04-28 09:02:34 +02:00
|
|
|
let thumbnail: UIImage?
|
2021-05-12 12:26:53 +02:00
|
|
|
let altText: String?
|
2021-04-28 09:02:34 +02:00
|
|
|
}
|
2022-01-27 14:23:39 +01:00
|
|
|
|
2021-04-28 09:02:34 +02:00
|
|
|
}
|