1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#if DEBUG
import UIKit
@MainActor
enum MediaPreviewContent {
static let image: UIImage = {
let renderer = UIGraphicsImageRenderer(size: CGSize(width: 600, height: 400))
return renderer.image { context in
UIColor.systemTeal.setFill()
context.fill(CGRect(x: 0, y: 0, width: 600, height: 400))
UIColor.systemYellow.setFill()
context.cgContext.fillEllipse(in: CGRect(x: 350, y: 50, width: 140, height: 140))
UIColor.systemIndigo.setFill()
context.fill(CGRect(x: 0, y: 280, width: 600, height: 120))
}
}()
static let imageURL = URL(fileURLWithPath: "/preview/image.png")
static let videoURL = URL(fileURLWithPath: "/preview/video.mp4")
static var attachment: ImageAttachment {
ImageAttachment(
data: image.pngData()!, altText: "A yellow sun over a teal landscape", mimeType: "image/png")
}
}
#endif