ios - XCode - Making ordered names imageView array? -


i made array of type uiimageview, , button add new imageview array want name each new image order image1, image2, image3 .. etc

var array = [uiimageview]()  @ibaction func addimage(_ sender: any) let newimage = uiimageview() self.view.addsubview(newimage) array.append(newimage) 

instead using name can work tag

newimage.tag = array.count  array.append(newimage) 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -