https://developer.apple.com/library/ios/documentation/Photos/Reference/PHAsset_Class/
var pixelWidth: Int { get }
var pixelHeight: Int { get }
资产图像或视频数据的宽度和高度(以像素为单位)。(只读)
如果资产的内容已被编辑,则此属性描述资产当前版本的大小。可用性 iOS(8.0 及更高版本)
if asset!.pixelHeight > asset!.pixelWidth {
// will be portrait video or Image
}
Run Code Online (Sandbox Code Playgroud)
在 iOS 8.0 及更高版本中可用。
| 归档时间: |
|
| 查看次数: |
1866 次 |
| 最近记录: |