rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

Device.camera.front uses rear camera #439

Open kobaltz opened 9 years ago

kobaltz commented 9 years ago

I've found that whenever using the front camera, the rear one is being displayed instead.

For example, the below code will show the rear camera (using iPad Mini 2 with iPhone device family)

  Device.camera.front.picture(media_types: [:image]) do |result|

However, if I specify the source type and camera device as below, it works.

  camera = Device.camera.front
  camera.picker.sourceType = UIImagePickerControllerSourceTypeCamera 
  camera.picker.cameraDevice = UIImagePickerControllerCameraDeviceFront
  camera.picture(media_types: [:image]) do |result|