UICollectionViewCell place cells side by side in landscape mode - swift

I have two stacked UICollectionViewCell's in my app in both portrait and landscape modes. However when in landscape mode I would like the cells to switch to side by side and rotate any of their contents appropriately as well. How do I do this? I am using xcode 8 and swift.

If I understood you correctly, you will need to detect orientation changes on the screen and when you detect landscape or portrait, change the Scroll Direction property to the one that you want either vertical or horizontal.

Related

StackView size change for different orientation

So, stack view of the contents seems to be aligned the way I designed them in the portrait mode. However, I the landscape mode the buttons seems to be stretching a lot. is there a way I could set up constraints that only work on these objects while in the landscape mode.
thanks,

Xcode storyboard view on rotation

I would like to have a view to the top or left of the device.
I have tried using a stack view to rotate the view but I was unable to use all interface orientations.
Example: the iPad orientation has a regular width and height in both portrait and landscape orientation. Thus I believe I cannot rotate the stack view axis on this device.
What are other options to keep the view how I want it preferably using the storyboard with auto-layout only but if needed using swift code.
Edit:
To clarify, both the blue and grey view can be seen as empty UIView for the purpose of this question.
To clarify, when you rotate the device, you want the text, buttons, etc to rotate but the background to stay the same (as in the view takes up the same screen area, but things in the view are rotated), correct?
If so, use size classes to give your views different constraints for different views

How to switch the live screen camera icons from portrait to landscape mode in iPhone?

I created a custom camera overlay for the live screen camera view and have imported my own custom icons for the camera, flash and flip buttons. Everything looks good in portrait mode, but when I switch the live camera screen to landscape mode, the orientation of the camera stays in portrait mode and shows this in console,
"Error: CGAffineTransformInvert: singular matrix"
I tried using the auto resizing mask, also have tried setting two different frames for the icons in both portrait and landscape mode in didRotateFromInterfaceOrientation method. But none of these are working.
My question is, will the landscape orientation support only the default iPhone camera overlay view or will it also support the custom overlayview.
Here are the screenshots indicating the behaviour of the icons repositioning each other when switched from portrait to landscape mode. I want exactly like this in my custom overlay view.
Edit:
I've made the live screen of my custom camera overlay to change by using the UIDevice Orientation method. But right now, the frame is not resizing when i try to switch from the portrait to landscape mode. So, i just want the entire frame to resize in landscape mode. Also, in this piece of code, if i try to change the value of CAMERA_TRANSFORM_Y,
#define CAMERA_TRANSFORM_X 1
#define CAMERA_TRANSFORM_Y 1.234
self.picker.cameraViewTransform = CGAffineTransformScale(self.picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
the size of the overlay view reduces both from the top and bottom margin. But, more size gets reduced from the bottom than from the top margin. I want the overlay size to change uniformly both from the top and from the bottom margin.
This is my sample code,
Sample project

different theme for landscape and portrait mode

Let me explain what I am creating and it will be nice if someone could tell me a better approach.
I am creating an app that supports all orientations. The app is like a power point presentation with several slides with several images and basic functionality in each slide. the functionality is very simple such as showing an image or moving an image when a button is pressed for example. So creating the app is not the problem. Since this app has to support all orientations when the device enters portrait mode I need to move the content in order to make it fit for the portrait orientation. And I would have to do the same thing if it enters landscape mode. Because there is so much content in every slide I need to change the content very much when changing orientation. so an image in portrait mode might have cords (20,5) and on landscape mode that image will have totally different coordinates.
So is there a way that I can set the IBOutlets have specific cords on landscape and specific cords on portrait with xcode. It takes me forever to store the cords of every IBOutlet in an array since I have so many IBOutles in each slide. I have to store the CGPoints in an array with the cords of IBOutlets in landscape and portrait mode and then if the device enters landsape mode set it's center equal to the array elemets. THIS IS SIMPLE BUT IT TAKES FOREVER!
Moreover I am creating many xib files and treat each xib as a different slide in my app.
With what you are saying, you need two xibs for each "slide". One that describes the portrait orientation, and one that describes the landscape orientation.

Portrait Orientation is losing touch input

I'm making a universal apps with auto rotation, and I'm only using landscape left and right. When I rotate the iPhone to the portrait down position, I can see what looks like a window underneath the app rotating and I no longer get touch events.
In all the shouldAutoRotate functions I'm making sure only return true for landscape, and the info.plist only allows landscape left and right.
Sounds like your view is not correctly resizing after an orientation change. Easy way to check this is to set the background color to something non-white.