iPhone camera in simulator

倾然丶 夕夏残阳落幕 提交于 2019-12-21 22:34:40

问题


Is there a way to test code using iPhone camera in the simulator?

(Somebody must have written something - you could have a replacement component that simulates the camera)


回答1:


In the simulator there are some sample photo library images that you can access.

Use: UIImagePickerControllerSourceTypePhotoLibrary




回答2:


If you want to test your actual camera API usage, you would have to closely emulate a fairly large non-trivial portion of the AVFoundation framework.

If you just want to test the rest of your app, you could just ifdef out all the camera related stuff and replace your image capture and preview data with a static png.



来源:https://stackoverflow.com/questions/3579792/iphone-camera-in-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!