WDImagePicker icon indicating copy to clipboard operation
WDImagePicker copied to clipboard

Not supported for camera?

Open kinfkong opened this issue 8 years ago • 7 comments

thanks

kinfkong avatar Jul 21 '16 07:07 kinfkong

+1

Isuru-Nanayakkara avatar Jul 29 '16 14:07 Isuru-Nanayakkara

+1

rafael-passos-dw avatar Sep 30 '16 15:09 rafael-passos-dw

+1

emilpedersen avatar Dec 01 '16 20:12 emilpedersen

+1

ThiagoRahal avatar Dec 05 '16 15:12 ThiagoRahal

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

saurabh-360 avatar Dec 25 '16 15:12 saurabh-360

You can add a convenience initializer as follows;

convenience init(_ sourceType : UIImagePickerControllerSourceType) { self.init() _imagePickerController.sourceType = sourceType }

AmmarMujeeb avatar Feb 27 '17 08:02 AmmarMujeeb

self.imagePicker.imagePickerController.sourceType = .camera

aakashtandukar avatar Jul 04 '17 05:07 aakashtandukar