Search code examples
iosxcodeios13ios14

Apps complied with xCode 11.7 but running on iOS 14+ issues


So I made the "mistake" of upgrading one of my devices to iOS 14 (currently iOS 14.0.1), which I found out that now I can NO longer deploy to that device via xCode, since I am still developing with xCode 11.7 and not the newest version of xCode 12.

I am still able to deploy to the device with iOS 14, because of utilizing testflight, regardless of it being on the newest iOS, but I am getting some really weird results!!

This is what the screen SHOULD look like, which is running on a device with iOS 13.7:

enter image description here

versus the result when the device is on the newer iOS 14.0.1 version:

enter image description here

Has anyone else witnessed this!?

Couple of questions:

  1. How does the text go from black to blue!?

  2. The main image is all blue vs rendering the true image!?

  3. In the case of the picker for "Origin" the image of the country flag is also all blue vs rendering correctly?

Is this the expected behavior of any app that is uploaded for sale in the iTunes Store which is compiled under an older version of xCode, my case xCode 11.7, vs the newest version?

I mean in the instance any person downloads the current version of the app created in an older version of xCode, but that user has the newest version of iOS on their phone, will the app become all messed up like that!? If so, what was apple thinking!?

Can anyone else provide ways they got around it, or what they experienced?

*** UPDATE ***

Providing the code for the text fields and pickers:

Here is the "default" Textfield:

TextField("Cigar Name", text: $model.cigarName)

Here is the code for the custom picker:

NavigationLink(destination: CountryPicker(cCode: $countryCode, cName: $countryName)) {
                            
    Text("Origin")
                            
    if countryCode != "" {
                                
        Spacer()
                                
        HStack() {
                                    
            Image(uiImage: UIImage(named: "CountryPicker.bundle/Images/\(countryCode)")!)
                .clipShape(Circle())
                                    
            Text(countryName)
                                    
        }
                                
    }
                            
}

Code for "default" picker:

Picker(selection: $selectedCigarStrength, label: Text("Strenght")) {
                                        
    ForEach(0 ..< cigarStrength.count) {
                                            
                                            
        Text(self.cigarStrength[$0])
                                            
    }
                                    
}

*** Latest Update ***

So I got my new MacBook and d/l xCode 12 for deployment to iphone with iOS 14.0.1 and this is what the screen shot looks like in comparison:

enter image description here

As you can see it looks way different!!! Good news is that the blue images went back to rendering the correct images in the sheet.. bad news is that the text is still blue!? I guess developers will have to strictly specify the text color going forward!? Which is weird... if no color is declared I would imagine it should stay .black by default... as it did in all other versions of xCode!?

Notice too that the form does not extend to the edge of the screen anymore and the date picker has really changed (which I actually like, finally something they actually improved in the new OS).


Solution

  • It would seem that iOS 14, for me 14.0.1, has serious issues with colors!?

    As noted above, now it would seem that you need to be explicit with the foregroundColor for Textfields and text alike and "force" them to a default color of black, as that used to be default... not sure why they changed that!

    The same thing goes for Navigation titles (navigationBarTitle), if you move from one tab that utilizes the title to another tab which does not require it, it will not remove the navigation bar title in the new view for some reason, UNLESS you "trick" the system with navigationBarTitle("") other wise force the blank title.

    Not sure why apple decided that everything needs to be explicit vs implicit as it was in the previous xcode and ios versions!?

    Another, which I think is a biggest issue, I have uncovered is the evaluation of the Nil-Coalescing Operator.

    I have the following condition:

    Button(action: {
                
        if (self.viewRouter.currentView != "menu") {
                   
            self.viewRouter.currentView = "menu"
                    
        }
                
    }) {
                
        Image("menu")
            .renderingMode(.template) //**** REQUIRED!!!!
                
    }
    .foregroundColor(self.viewRouter.currentView == "menu" ? .blue : .gray)
    

    This simple condition states that if the view currently clicked on is the "menu" then the color of the button should be blue vs if its not and a different view is being displayed it should be gray... the end result is that the button is black and no matter which I select in the tab bar they all remain black and not not change color as they do on my device that i am running iOS 13.6!?

    *** UPDATE ***

    Again ios 14 became a lot more explicit!! you need to add the .renderingMode(.template) in order to achieve the same result in the pre-ios 14 era.