iOS14 UICollectionView Not Displaying Properly - uicollectionview

After upgrading to XCode12 and iOS14 I have an issue in one collection view which does not display as it did when compiling for iOS 13.6. The order of the cells is wrong and the spacing/dimensions are as well. Please see the picture (top, in the oval). In the iOS13.6 build, the cells were equally spaced, did not overlap, and were in a different order. This happens both on the simulator as well as on the actual device.
The code has not changed at all (still uses the delegates).
Does anyone have any clue?
Thanks

Related

Behavior changes for updateViewConstraints in iOS 8

I notice some small graphical glitches while testing one of my app under iOS 8: some UIViews elements are not in the right place, others have not the right size.
In a first step, I use storyboard, Auto-Layout and constraints. Then I programmatically tune constraints to perfectly suits devices' screen size, using updateViewConstraints.
Perfect on iOS 7 but with some glitches on iOS8 as on following picture:
./Users/dominiquevial/Documents/Informatique/Dev/Novae Marathon/_log/captures/iOS8 - iPhone 6/pause.png
After investigation I found the problem: updateViewConstraints is not called. I don't understand why, maybe due to some optimizations...
Correcting this problem is easy :
use viewWillLayoutSubviews in place of updateViewConstraints
or add call to setNeedsUpdateConstraints in viewWillAppear
Which way is the best one ?
Depends if the user can cause the views to enter an invalid state after the view appears, if so the first option. If this is not possible the second.
The less work your app has to do the better.

iOS App won't use 4 inch size even with default-568h#2x image

Everything I read (including on Stack) keeps saying that in order to have an app use the entire 4" iPhone screen you simply have to add a default-568h#2x.png image with a resolution of 1136 x 640.
I've added this image and when I run on a 4" iPhone simulator everything (including the launch image) renders windowed with the black bars at the top and bottom. I've tried deleting and re-adding the image, made sure it shows up as the 4" launch image in the Target summary tab, and adjusted all of the simulated metrics sizes in my storyboard to be Retina 4 full screen. Even with all of this, I'm still getting the old 3.5" window.
Is there something I'm missing or doing wrong?
You spelled Default-568h#2x.png wrong. Remember that iOS is a case sensitive file system, so the capital "D" matters. (I had a very similar problem -- which is what led me to this question -- because I was missing the "h" )
I'm not certain on what the issue is but a couple more checks you could do would be to make sure you have built the latest version of your project before simulation. The simulator may be launching a previous build that did not have the 4# images
Maybe try temporarily removing your smaller resolution images to see if that makes a difference.
Also make sure when the simulator is open that you have the correct hardware configuration in the hardware tab

Unknown Issue when trying to add core location

I'm working on an app where I have a subclass of a UIView that contains seven subviews with orientations arranged such that they form a 7-sided shape. Each of these subviews has additional subviews in front of them that are oriented the same way as the main view.
Fine so far. Then I tried adding some code to tap into core location services. I used the basic procedure outlined at this tutorial. Using the code as it is presented there, I successfully got the heading to display in the debugger window.
Next step was to tie it into my app. To make sure I was on the right track, I simply added this code:
float radianHeading = newHeading.trueHeading * M_PI / 180;
CGAffineTransform transformTrollCalendar = CGAffineTransformMakeRotation(radianHeading);
[self setTransform:transformTrollCalendar];
There are two issues. The first is that the view is not visibly rotated. I was prepared for that, because I probably have to trigger something to redraw the view. However, I get another problem that has me worried.
When I get a bunch of updates from the compass, the connection between my mac and my iPad gets lost, as evidenced by the stop button turning grey. Moments later, the iPad makes the sound that you get when you connect the cable to the Mac or power. Then I get the slider that you get when you first power up the iPad. I figure this means I'm doing something majorly wrong. However, the app still appears to be running on the iPad, and it is not generating any crash logs.
I resolved my own problem. Apparently, the problem was the result of my putting the code into the wrong method. I don't remember anymore which wrong method I placed the code into, but when I placed it in the correct method, it worked just fine.
I would have updated this sooner, when it was still fresh on my mind, but I've had a trip to Guatemala in the interim that has caused my memories of this problem to fade.

iPad not all screen recognising touches

So my current app project is a camera based app and all is going well so far but I have run in to a weird little issue and don't know if there's something basic i'm missing or if it's something more complex.
When I run my app on the iPad in landscape mode (right hand home button), the right end of the screen doesn't recognise touch down events, though if an item is spread across the border (half recognising touches, half not) and you press on the good half and drag, it still recognises the touch and also recognises the touch up event when you let go. Through testing, I worked out that it works fine up to pixel 768 so this makes me think that one of the views thinks that the application is still running in portrait. But then when I run it in portrait, the bottom section (same portion) doesn't work either.
I have looked at another couple of posts on SO:
Article 1
Article 2
I have tried the fixes they say, but have had no luck as of yet. It may be something to do with the fact I have various different views created both programatically and in the interface builder and somewhere along the way, something isn't being initialised correctly but I have tried changing them all, I may have missed some though.
If anybody can shed any light on my situation, that would be greatly appreciated.
Thanks,
Matt
I think the problem has something to do with autoresizing mask. Have you set this? Try to set the background color of all views to see where they are.

ObjC - Hiding the separator lines of a UITableView on iPhone

I try to do this with following line:
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
and it works! on the simulator.. strangely when I run the app on the iPhone (3Gs) they show up again.
Any ideas why this could be happening?
(Also labels and images of my custom cells are displayed on wrong positions, maybe its the same problem)
There is absolutely no difference between the simulator and the device code (it's the same code that gets compiled).
It seems it was an Apple bug. I updated to iOS 4.0.1 (with XCode+SDK update as well of course) and now everything works just fine.