How can I only display a UIButton if the front camera is present on the user’s device? The use of the front camera (via a video “Record” UIButton) is a feature of my app but not a requirement, so I want to hide the button on devices without front cameras. I do not know how to implement isCameraDeviceAvailable in this instance so specific code and how to place it would be appreciated.
Thank you for any assistance.
This should do the trick in your viewDidLoad of the controller with the view. It will only add the button to the subview if the camera is present. You should probably put the entire button creation in there for efficiency sake. If you add it with InterfaceBuilder you could always reverse it and hide the button it its not present.