Hide a subview with a tag

ios, swift

Solution

It's the same way with Objective-C, just has a different syntax;

view.viewWithTag(tag).removeFromSuperview()

Problem

In swift I can give a view a tag ``` let MY_CUSTOM_TAG = 123 tableView.tag = MY_CUSTOM_TAG ``` My question is, how do I remove a view from the superview with a tag using swift? Objective C example: ``` #define MY_CUSTOM_TAG 1234 mySubview.tag = MY_CUSTOM_TAG; [self.tableView addSubview:mySubview] ; //remove view with tag [[self.tableView viewWithTag:MY_CUSTOM_TAG]removeFromSuperview] ; ```

Original source