I have one image similar to disclosure. Initially, it will look like a drop-down image. Therefore, when the user pops up a drop-down list, some parameter will be shown. So what I need is when the dropdown menu is true. I mean, when the user clicks the dropdown image, and when the list of options is displayed down, I need to show the dropdown image 180 degrees. Same as falling down, false. it is necessary to show the image as a normal position.
Is this method correct and not use another image? I am using fast 2.2
Updated:
@IBAction func dropBtnPress(sender: AnyObject) {
if dropDown.hidden {
dropDown.show()
UIView.animateWithDuration(0.0, animations: {
self.image.transform = CGAffineTransformMakeRotation((180.0 * CGFloat(M_PI)) / 180.0)
})
} else {
dropDown.hide()
}
}
}
source
share