你是指這個代碼posted here:
他們在代碼中創建變量:
var exifOrientationFromDeviceOrientation: Int32 {
let exifOrientation: DeviceOrientation
enum DeviceOrientation: Int32 {
case top0ColLeft = 1
case top0ColRight = 2
case bottom0ColRight = 3
case bottom0ColLeft = 4
case left0ColTop = 5
case right0ColTop = 6
case right0ColBottom = 7
case left0ColBottom = 8
}
switch UIDevice.current.orientation {
case .portraitUpsideDown:
exifOrientation = .left0ColBottom
case .landscapeLeft:
exifOrientation = .top0ColLeft
case .landscapeRight:
exifOrientation = .bottom0ColRight
default:
exifOrientation = .right0ColTop
}
return exifOrientation.rawValue
}
謝謝,樓主!我會看看這個GitHub頁面,看看我能從中學到什麼。最好的祝福。 –