This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Not supported for camera? #8
Comments
+1 |
3 similar comments
+1 |
+1 |
+1 |
You can change the WDImagePicker class's init method to take the source type as Camera override public init() {
super.init()
self.cropSize = CGSizeMake(320, 320)
_imagePickerController = UIImagePickerController()
_imagePickerController.delegate = self
_imagePickerController.sourceType = .Camera
} Or you can write your own custom init method to switch to camera or photoGallery, override public init(withSourceType sourceType : UIImagePickerControllerSourceType) {
super.init()
self.cropSize = CGSizeMake(320, 320)
_imagePickerController = UIImagePickerController()
_imagePickerController.delegate = self
_imagePickerController.sourceType = .sourceType
} and then, initialise like this self.imagePicker = WDImagePicker.init(withSourceType: .Camera) // For Camera or self.imagePicker = WDImagePicker.init(withSourceType: .PhotoLibrary) //For Gallery |
You can add a convenience initializer as follows; convenience init(_ sourceType : UIImagePickerControllerSourceType) { |
self.imagePicker.imagePickerController.sourceType = .camera |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
thanks
The text was updated successfully, but these errors were encountered: