BRNImagePickerSheet 介绍
BRNImagePickerSheet是一款模仿iOS8’s iMessage的图片选择器。在选项列表视图中可以滚动显示待选图片。
示例代码:
let placeholder = BRNImagePickerSheet.selectedPhotoCountPlaceholder var sheet = BRNImagePickerSheet() sheet.addButtonWithTitle("Take Photo Or Video", singularSecondaryTitle: "Add Comment", pluralSecondaryTitle: nil) sheet.addButtonWithTitle("Photo Library", singularSecondaryTitle: "Send \(placeholder) Photo", pluralSecondaryTitle: "Send \(placeholder) Photos") sheet.delegate = self sheet.showInView(self.view) func imagePickerSheet(imagePickerSheet: BRNImagePickerSheet, willDismissWithButtonIndex buttonIndex: Int) { if buttonIndex != imagePickerSheet.cancelButtonIndex { if imagePickerSheet.showsSecondaryTitles { println(imagePickerSheet.selectedPhotos) } else { let controller = UIImagePickerController() controller.delegate = self controller.sourceType = (buttonIndex == 2) ? .PhotoLibrary : .Camera self.presentViewController(controller, animated: true, completion: nil) } } }
BRNImagePickerSheet 官网
https://github.com/larcus94/BRNImagePickerSheet
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。