I have a simple image detail view, but the problem is either I rotate the image 90 degrees and images taken in landscape mode are properly rotated, but pictures taken in portrait mode aren't. I'd like to read the mode of the image and switch on it if possible?
I also found this answer but am not able to convert an Image
back to a UIImage
to use it.
import SwiftUI
struct DetailImageView: View {
@Binding var showingSheet: Bool
var image: Image?
var body: some View {
if let unwrappedImage = image {
unwrappedImage
.resizable()
.scaledToFit()
.edgesIgnoringSafeArea(.all)
//.rotationEffect(.degrees(90))
}
}
}