39 lines
811 B
Swift
39 lines
811 B
Swift
import Foundation
|
|
|
|
enum SharingCameraMediaType: Stateable {
|
|
case video
|
|
case photo
|
|
}
|
|
|
|
struct SharingGalleryItem: Stateable, Identifiable {
|
|
var id: String
|
|
var type: SharingCameraMediaType
|
|
var thumbnail: Data?
|
|
var duration: String?
|
|
}
|
|
|
|
struct SharingState: Stateable {
|
|
var sharingShown: Bool
|
|
var isCameraAccessGranted: Bool
|
|
var isGalleryAccessGranted: Bool
|
|
|
|
// var cameraCapturedMedia: Data
|
|
// var cameraCapturedMediaType: SharingCameraMediaType
|
|
|
|
var galleryItems: [SharingGalleryItem]
|
|
}
|
|
|
|
// MARK: Init
|
|
extension SharingState {
|
|
init() {
|
|
sharingShown = false
|
|
isCameraAccessGranted = false
|
|
isGalleryAccessGranted = false
|
|
|
|
// cameraCapturedMedia = Data()
|
|
// cameraCapturedMediaType = .photo
|
|
|
|
galleryItems = []
|
|
}
|
|
}
|