MijickCamera/Sources/Internal/Models/MCameraMedia.swift

29 lines
796 B
Swift
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MCameraMedia.swift of MijickCamera
//
// Created by Tomasz Kurylik. Sending from Kraków!
// - Mail: tomasz.kurylik@mijick.com
// - GitHub: https://github.com/FulcrumOne
// - Medium: https://medium.com/@mijick
//
// Copyright ©2024 Mijick. All rights reserved.
import SwiftUI
public struct MCameraMedia: Sendable {
let image: UIImage?
let video: URL?
init?(data: Any?) {
if let image = data as? UIImage { self.image = image; self.video = nil }
else if let video = data as? URL { self.video = video; self.image = nil }
else { return nil }
}
}
// MARK: Equatable
extension MCameraMedia: Equatable {
public static func == (lhs: MCameraMedia, rhs: MCameraMedia) -> Bool { lhs.image == rhs.image && lhs.video == rhs.video }
}