5 Replies
      Latest reply on Jul 22, 2019 6:38 AM by TAFKAS
      TAFKAS Level 1 Level 1 (0 points)

        Hi all,

        I'm recently became an enrolled developer, mainly for learning and fun.

        I'm trying to learn studying online and by doing iOS apps but sometime I got stuck and I cannot find answers anywhere.

        Maybe it's a silly question and if that's the case please forgive me to have wasted your precious time, but if it's not please can someone explain to me how to do this?

         

        I have a bunch of UIImageViews outlets (36 to be exact, arranged in a grid of 6x6 squares) and I would like to know if there's a way to do something like this:

         

        @IBOutlet weak var quadrato01: UIImageView!
        ....
        ....
        ....
        ....
         @IBOutlet weak var quadrato36: UIImageView!
        
        
        let numero = 08
        
        
        quadrato(numero).backgroundColor = UIColor.red
        
        

        I know that is terribly wrong but I didn't know how to explain to you. The numero constant is only for explaining that somewhere in the code I have a number that I would like to attach at the end of the quadratoXX name outlet to acces its properties.

        Sorry if I'm not explaining clearly but I'm not English speaking

         

        Thanks in advance for any help and feel free to ask me other info if I was not clear enough