在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:hyperoslo/ImagePicker开源软件地址:https://github.com/hyperoslo/ImagePicker开源编程语言:Swift 99.2%开源软件介绍:DescriptionImagePicker is an all-in-one camera solution for your iOS app. It lets your users select images from the library and take pictures at the same time. As a developer you get notified of all the user interactions and get the beautiful UI for free, out of the box, it's just that simple. ImagePicker has been optimized to give a great user experience, it passes around referenced images instead of the image itself which makes it less memory consuming. This is what makes it smooth as butter. UsageImagePicker works as a normal controller, just instantiate it and present it. let imagePickerController = ImagePickerController()
imagePickerController.delegate = self
present(imagePickerController, animated: true, completion: nil) ImagePicker has three delegate methods that will inform you what the users are up to: func wrapperDidPress(_ imagePicker: ImagePickerController, images: [UIImage])
func doneButtonDidPress(_ imagePicker: ImagePickerController, images: [UIImage])
func cancelButtonDidPress(_ imagePicker: ImagePickerController) ImagePicker supports limiting the amount of images that can be selected, it defaults to zero, which means that the user can select as many images as he/she wants. let imagePickerController = ImagePickerController()
imagePickerController.imageLimit = 5 Optional bonusConfigurationYou can inject var configuration = Configuration()
configuration.doneButtonTitle = "Finish"
configuration.noImagesTitle = "Sorry! There are no images here!"
configuration.recordLocation = false
let imagePicker = ImagePickerController(configuration: configuration) Resolve assetsAs said before, ImagePicker works with referenced images, that is really powerful because it lets you download the asset and choose the size you want. If you want to change the default implementation, just add a variable in your controller. public var imageAssets: [UIImage] {
return AssetManager.resolveAssets(imagePicker.stack.assets)
} And when you call any delegate method that returns images, add in the first line: let images = imageAssets FAQLimiting selection to 1 itemlet config = Configuration()
config.allowMultiplePhotoSelection = false
let imagePicker = ImagePickerController(configuration: config)
imagePicker.delegate = self InstallationImagePicker is available through CocoaPods. To install it, simply add the following line to your Podfile: pod 'ImagePicker' ImagePicker is also available through Carthage. To install just write into your Cartfile: github "hyperoslo/ImagePicker" AuthorHyper made this with ContributeWe would love you to contribute to ImagePicker, check the CONTRIBUTING file for more info. LicenseImagePicker is available under the MIT license. See the LICENSE file for more info. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论