mardi 10 juillet 2018

how to use if condition depending on uiview background color

I am trying to use a if statement depending on the background color of the view controller.

        if   view.backgroundColor = .red {

    }

This is not working. Its giving me a error Value of type 'UIColor?' has no member 'red'. I just want the if statement to depending on the programmatically set background color.

Aucun commentaire:

Enregistrer un commentaire