Aim:
Targeting different iPhone and iPad sized displays, I’m wanting to arrange many small square UIView in a pattern. Once arranged in place, I want to be able to control each UIView so that I can manipulate each one, for example, move and scale each individually.
One approach would be to place many small UIView manually on the Storyboard (Image 1), making sure to have enough small UIView to arrange in a pattern on the largest iPad screen, and then connect them all up in code. For example
@IBOutlet weak var myView001: UIView!
@IBOutlet weak var myView002: UIView!
...
...
@IBOutlet weak var myView144: UIView!
But, the above approach seems very complex and not elegant.
Question:
How can I dynamically (and elegantly) create many small
UIView, that can be arranged in a pattern to fit the smallest iPhone screen and the largest iPad screen, that can be manipulated in Swift code?
Image 1:
