Self-solved.
import SwiftUI
import PhotosUI
struct LivePhotoView: View {
let livePhoto: PHLivePhoto
var body: some View {
_LivePhotoView(livePhoto: livePhoto)
.aspectRatio(livePhoto.size.width / livePhoto.size.height, contentMode: .fill)
}
}
struct _LivePhotoView: UIViewRepresentable {
let livePhoto: PHLivePhoto
func makeUIView(context: Context) -> PHLivePhotoView {
let livePhotoView = PHLivePhotoView(frame: .zero)
livePhotoView.livePhoto = livePhoto
return livePhotoView
}
func updateUIView(_ livePhotoView: PHLivePhotoView, context: Context) {
}
}