EDIT:
I'm now also having issues setting a UIImageView to a PDF File thats in the Assets.xcassets folder.
Relatively new. (~8 months) so this is my first time experience a major software release.
I have some code the preloads data on the first launch to populate CoreData. And in iOS 14, theres an issue with some of the images being converted from a PDF file in the Assets folder into JPEG binary Data. (Note: Not all of the images, but some)
Replacing the image in the folder doesn't fix it, but adding other images works just fine.
I also tried the iOS 13 simulator and it is (still) working and loads data as intended.
It appears theres an issue with this line of code:
// images: [UIImage]?
if let imagesArray = images {
for (i, imageData) in imagesArray.enumerated() {
if let imagePNGData = imageData.jpegData(compressionQuality: 0.9) {
imagesArray makes the optional Array non-optional. And then it runs a loop to convert the UIImage into Data.
However, I added some print commands and got this:
images?.count: Optional(3)
Inside: if let imagesArray = images {
Inside: for (i, imageData) in imagesArray.enumerated() {
New Loop: --- 0
(i, imageData): 0 : <UIImage:0x600000a7e1c0 named(main: untAmberCelodonthree) {792, 612}>
inside: if let imagePNGData = imageData.jpegData(compressionQuality: 0.9) {
imagePNGData: 0 bytes
End: Loop 0:
New Loop: --- 1
(i, imageData): 1 : <UIImage:0x600000a7df80 named(main: untAmberCelodonTwo) {612, 792}>
inside: if let imagePNGData = imageData.jpegData(compressionQuality: 0.9) {
imagePNGData: 0 bytes
End: Loop 1:
New Loop: --- 2
(i, imageData): 2 : <UIImage:0x600000a7e2e0 named(main: untAmberCelodon) {612, 792}>
inside: if let imagePNGData = imageData.jpegData(compressionQuality: 0.9) {
imagePNGData: 1035328 bytes
End: Loop 2:
End: if let imagesArray = images {
I'm not entirely sure why the UIImage isn't being converted to data...
But basically, is this an Xcode/IOS14 issue? Or am I doing something wrong?