Skip to content
Browse files

Merge pull request #10 from chalkers/master

:upside_down_portrait to :portrait_upside_down
  • Loading branch information...
2 parents d2f1002 + bce3861 commit b0075c75b91c34247e0be47c94c4d99bc52857e5 @siuying siuying committed
Showing with 14 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +13 −1 lib/kernel.rb
View
1 .gitignore
@@ -0,0 +1 @@
+build/
View
14 lib/kernel.rb
@@ -12,6 +12,18 @@ def ipad?
UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad
end
+ # Verifies that the device running has a front facing camera.
+ # @return [TrueClass, FalseClass] true will be returned if the device has a front facing camera, false otherwise.
+ def front_camera?
+ UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDeviceFront)
+ end
+
+ # Verifies that the device running has a rear facing camera.
+ # @return [TrueClass, FalseClass] true will be returned if the device has a rear facing camera, false otherwise.
+ def rear_camera?
+ UIImagePickerController.isCameraDeviceAvailable(UIImagePickerControllerCameraDeviceRear)
+ end
+
# Returns the application's document directory path where users might be able to upload content.
# @return [String] the path to the document directory
def documents_path
@@ -26,7 +38,7 @@ def orientation
case UIDevice.currentDevice.orientation
when UIDeviceOrientationUnknown then :unknown
when UIDeviceOrientationPortrait then :portrait
- when UIDeviceOrientationPortraitUpsideDown then :upside_down_portrait
+ when UIDeviceOrientationPortraitUpsideDown then :portrait_upside_down
when UIDeviceOrientationLandscapeLeft then :landscape_left
when UIDeviceOrientationLandscapeRight then :landscape_right
when UIDeviceOrientationFaceUp then :face_up

0 comments on commit b0075c7

Please sign in to comment.
Something went wrong with that request. Please try again.