Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Not supported for camera? #8

Open
kinfkong opened this issue Jul 21, 2016 · 7 comments
Open

Not supported for camera? #8

kinfkong opened this issue Jul 21, 2016 · 7 comments

Comments

@kinfkong
Copy link

thanks

@Isuru-Nanayakkara
Copy link

+1

3 similar comments
@rafael-passos-dw
Copy link

+1

@emilpedersen
Copy link

+1

@ThiagoRahal
Copy link

+1

@saurabh-360
Copy link

saurabh-360 commented Dec 25, 2016

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

@AmmarMujeeb
Copy link

AmmarMujeeb commented Feb 27, 2017

You can add a convenience initializer as follows;

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

@aakashtandukar
Copy link

self.imagePicker.imagePickerController.sourceType = .camera

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants