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
Post a Comment