//removing all subviews from view.
for (UIView *view in self.subviews) {
[view removeFromSuperview];
}