ios - ABPeoplePickerNavigationController 从联系人 Swift 获取图像

标签 ios swift

有人能告诉我如何在 Swift 中从选定的人那里获取图像吗?我使用 PeoplePicker NavigationController..

最佳答案

if ABPersonHasImageData(person ) {
    let profilePicture = UIImage(data: ABPersonCopyImageDataWithFormat(person, kABPersonImageFormatOriginalSize).takeRetainedValue())!
    let profilePictureThumbnail = UIImage(data: ABPersonCopyImageDataWithFormat(person, kABPersonImageFormatThumbnail).takeRetainedValue())!
    println("\(profilePicture)")
    println("\(profilePictureThumbnail)")
}

关于ios - ABPeoplePickerNavigationController 从联系人 Swift 获取图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28693772/

相关文章:

ios - 如何在 Xcode 中调整 UIStackView 的 subview ?

iOS Swift - 滚动时如何向上移动搜索栏?

ios - 应用程序终止后发送本地通知

arrays - 将从核心数据检索图像放入数组 swift

swift - 无法在 swift 中编辑 get only 变量

ios - Swift:如何将 Action 链接到 tableViewCell 内的 View ?

ios - Apple Watch 应用程序的二进制大小

ios - 带有自定义字体的 UITextField secureTextEntry 项目符号?

android - 每次从构建类中 flutter 停止底部导航栏

ios - 从另一个 vc 重新加载 vc TableView 支持的最佳方法