UIActionSheet button mask messed up after showing QLPreviewController - ios

I am working on a photo-sharing app. The users can take and upload photos, and I use an UIActionSheet to provide selection whether to take a new photo with the camera or choose an existing photo from the library. In an other view I have a list of uploaded photos, and if the user taps on a photo it becomes full screen with QLPreviewController. My problem is that if the preview controller was once opened in full screen, in the completely different view controller of upload the button masks of the action sheet messes up this way:
Any idea how to avoid this (obviously) bug of the framework?

It should be issue with statusBarOrientation.
Try to add
[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationPortrait;
in viewWillAppear:.

Related

Tapping preview in context menu on iPad doesn't animate presentation of full screen view controller

I have a context menu in my app that shows a photo preview above the actions, and tapping the preview presents that view controller full-screen. On iPhone, when you tap the preview there’s a lovely animation - it bounces into full screen. But on iPad, when you tap the preview the context menu dismisses and then the screen appears without any animation.
This is the (new*) default behavior on iPad. The idea being you can use your own presentation animation. To get the system "pop" style that's default on iPhone, set the preferredCommitStyle to .pop on the UIContextMenuInteractionCommitAnimating object.
*I think it changed in iOS 13.4. This change broke the Photos app as well. 😅

Autorotate Portrait mode documents if it is showing as landscape

In my app user scans(captures photos of) documents. For uploading to the server.
I want to programmatically detect the document's orientation.
It looks like this.
And then user tap that circular arrow button and make it portrait.
Then it looks like this
I want to do this rotation task automatically.
Please let me know how we can do this, I never came across this kind of requirement.

iOS UIImagePickerController shows wrong button after locking phone

I have an app with take photo functionality (like Instagram application).
I use UIImagePickerController with source type is equal to UIImagePickerControllerSourceTypeCamera to take photo.
After I present UIImagePickerController it has one default button: 'Cancel'. After user takes photo there are two buttons: 'Retake' and 'Ready'. But if user lock a screen and unlock it again - there is only 1 button: 'Cancel' and the rest of UI is unresponsive (you cannot touch to take photo button again).
Is iOS specific problem or I'm doing something wrong?

iPad forces portrait mode when touching 'Take Photo or Video'

I've built an HTML5 iPad web app in landscape mode, now I'm to the point I need to let the user add an image either from taking an image or choosing one from the camera roll.
Here's the problem:
The iPad is locked in landscape mode, user touches my button: 'Add Photo' Apple menu alerts: 'Take Photo or Video' or 'Choose Existing' User touches 'Take Photo or Video'.
When the Camera slides over and opens up the web app goes into portait mode!, and after the user takes the image or even cancels out of taking an image my web app is stuck in portrait mode and will not go back into landscape until you unlock the iPad, turn to portrait then back to landscape!!
Note: if the user selects 'Choose Existing' and uploads from the camera roll there is no issue.
Is there anything I can do? Is there a way to not provide the 'Take Photo or Video' option and only allow the 'Choose Existing' option?
Thank you in advance!
I've run into a similar problem. In my case the camera roll is only showing in portrait mode on my iPad which I'm using in landscape. After looking through the API reference it looks like this is by design:
Important: The UIImagePickerController class supports portrait mode
only. This class is intended to be used as-is and does not support
subclassing. The view hierarchy for this class is private and must not
be modified, with one exception. You can assign a custom view to the
cameraOverlayView property and use that view to present additional
information or manage the interactions between the camera interface
and your code.
UIImagePickerController Reference

how can i make a custom, in-app camera for my iphone app developed in xcode?

i am making a photography iphone app and am after, upon the app being launched, the screen to be a large image where the camera is shown in the center through a hole in the picture - this should be a similar look to that of hipstamatic. since the camera would be open upon launch, i would also need a button to take the picture (but that is not a priority at the moment). i am wondering whether there is an easy way to do what i have described? so far, research has pointed me towards using the uiimagepickercontroller, but using just this did not give me nearly the amount of customization i am after - or am i mistaken and i can do as i described using the uiimagepickercontroller?
right now, this is the code i'm using for the camera - it's currently an ibaction linked to a button that launches the camera once clicked. however, as i mentioned, i would like the camera to open on its own upon opening the app
self.picker = [[UIImagePickerController alloc] init];
self.picker.allowsEditing = NO;
[self.picker setSourceType:UIImagePickerControllerSourceTypeCamera];
[self presentModalViewController:self.picker animated:NO];
[picker release];
this code not only navigates away from the current view, but it has all the controls (zoom, tap to focus, etc.), is full screen, and plays that silly animation of the lens opening.
anything you have to offer would be greatly appreciated.
many thanks in advance
zach
Use the showsCameraControls and cameraOverlayView properties of UIImagePickerController to add custom overlay above the picker (using a view with a transparent background in which you add some elements as subviews to overlay / frame / mask some parts of the picker if needed.)
You can even use the cameraViewTransform to change the size and position (i.e. the transform) of the camera view that is capturing the camera image.

Resources