Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.8k
stars
975
forks
source link
feat(camera): add overlay image view support in the camera config #951
Hi @longitachi, thanks for reviewing my previous PRs, here is (hopefully) the last one from my side :D.
This PR introduces a new feature to the camera config that allows users to add an overlay view on top of the camera view (useful for different kinds of scanners). This enhancement is designed to improve the camera's flexibility and functionality, especially for users who need to display custom overlays while capturing photos or videos. Again, this feature is similar to the overlay functionality available in the original UIImagePickerController.
Key Changes
Added a new UIView property overlayView to ZLCameraConfiguration.
Updated the setupUI method in ZLCustomCamera to add the overlayView to the view hierarchy if it is provided.
Updated the viewDidLayoutSubviews method in ZLCustomCamera to layout the overlayView if it is provided.
Added a new method overlayView(_ value: UIView) -> ZLCameraConfiguration to ZLCameraConfiguration for chaining configuration.
Benefits
Flexibility: This feature allows users to add custom overlays to the camera view, providing more options for displaying additional information or UI elements while capturing photos or videos.
User Experience: Users can now display custom overlays, which is especially useful for adding branding, guides, or other visual elements to the camera view.
Non-Breaking Change
This change is non-breaking and does not affect existing functionality. The overlay view feature is optional and can be enabled by setting the overlayView parameter in ZLCameraConfiguration.
Please review the changes and let me know if there are any adjustments or additional features you would like to include. Thank you!
Hi @longitachi, thanks for reviewing my previous PRs, here is (hopefully) the last one from my side :D.
This PR introduces a new feature to the camera config that allows users to add an overlay view on top of the camera view (useful for different kinds of scanners). This enhancement is designed to improve the camera's flexibility and functionality, especially for users who need to display custom overlays while capturing photos or videos. Again, this feature is similar to the overlay functionality available in the original
UIImagePickerController
.Key Changes
UIView
propertyoverlayView
toZLCameraConfiguration
.setupUI
method inZLCustomCamera
to add theoverlayView
to the view hierarchy if it is provided.viewDidLayoutSubviews
method inZLCustomCamera
to layout theoverlayView
if it is provided.overlayView(_ value: UIView) -> ZLCameraConfiguration
toZLCameraConfiguration
for chaining configuration.Benefits
Non-Breaking Change
This change is non-breaking and does not affect existing functionality. The overlay view feature is optional and can be enabled by setting the
overlayView
parameter inZLCameraConfiguration
.Please review the changes and let me know if there are any adjustments or additional features you would like to include. Thank you!