swift how to reverse animation when button is pressed for second time i.e. from selected/isselected step to default step

swift how to reverse animation when button is pressed for second time i.e. from selected/isselected step to default step
 
 
Q