Reputation: 416
I am working on client app with swift . This is my first app on swift . I am trying to open camera from my app using UIImagePickerController . Below i have added snap of my code . It's working fine on IPhone 5s and 6s with iOS 9.2.1 .But when i am trying to open on iPod Touch with iOS 8.3 it gives black view with button controls. I have attached screen shot also which shows how it looks like. Please help me to come out from this .
Code:
if UIImagePickerController.isSourceTypeAvailable(.Camera) {
imagePickerViewController = UIImagePickerController()
imagePickerViewController?.delegate = self
imagePickerViewController?.allowsEditing = true
imagePickerViewController?.sourceType = .Camera
imagePickerViewController?.mediaTypes = [kUTTypeImage as String]
imagePickerViewController?.cameraCaptureMode = .Photo
presentViewController(imagePickerViewController!, animated: true, completion: nil)
}
else
{
print("Sorry cant take picture")
}
Upvotes: 1
Views: 733
Reputation: 5602
I tried out the same on my device & it worked fine. So there is no issue with code.
Now i tried to generate the issue which you have on iPod. See this steps:
I hope this will guide you.
Upvotes: 1