Swift writing a function that takes self as an input
I have alert that is being fired from different location so I decided to make a function to be called. func alertSCFlag(x: Int) { var alert = UIAlertController() switch x { case 1: alert = UIAlertController(title: "Not Finished", message: "sorry but you must give the project a title and description", preferredStyle: UIAlertControllerStyle.alert) default: alert = UIAlertController(title: "Not Finished", message: "sorry but you need to choose a type of project", preferredStyle: UIAlertControllerStyle.alert) } alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: