var callback: ((successful:Bool)->Void)? = nil
popup.callback = {(successful:Bool)->Void in
if successful {
// something
} else {
// something
}
}
if let callback = callback {
callback(successful: true)
}
UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(vc, animated: true, completion: nil)