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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -