【发布时间】:2019-05-15 11:10:29
【问题描述】:
为什么UIImagePickerController.InfoKey 类型是struct 而不是字符串,使用struct 作为字典键而不是字符串有什么好处?
public struct InfoKey : Hashable, Equatable, RawRepresentable {
public init(rawValue: String)
}
}
extension UIImagePickerController.InfoKey {
public static let mediaType: UIImagePickerController.InfoKey
public static let originalImage: UIImagePickerController.InfoKey // a UIImage
public static let editedImage: UIImagePickerController.InfoKey // a UIImage
public static let cropRect: UIImagePickerController.InfoKey // an NSValue (CGRect)
【问题讨论】:
标签: ios swift dictionary uiimagepickercontroller