iphone - ipad 2 摄像头支持检测

标签 iphone objective-c ipad camera

我有一个使用以下宏的应用:

#define IS_IPAD ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

这对我来说效果很好。

但是,我用它来关闭应用程序中拍照的选项。

无论设备如何,如何检测相机选项是否可用?

最佳答案

[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];

这应该行得通

关于iphone - ipad 2 摄像头支持检测,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5863328/

相关文章:

iphone - 在应用程序内创建的文件的pathForResource

ios - 在 Swift 中获取按钮单击 UITableView

ios - 使用新的 Firebase Messaging SDK 在 iOS 中发送通知

ios - 寻找 iPad 开发的地理编码/映射建议

ios - 通用应用程序以纵向模式启动,即使它仅限于横向

iphone - 同时隐藏状态栏和导航栏,就像在图片应用程序中一样

iphone - Swift 中的 Dropbox 集成

iphone - Three20 应用商店拒绝 (UITouch) - 删除了违规代码,发布版本但以二进制形式存在

ios - 如何为密码加密文件提供忘记密码选项?

iphone - 单个 Controller 管理模型和多个 View Controller ?