Created
July 18, 2017 04:51
-
-
Save mayooresan/60581f5cca9816ec4b24284d6dcd43c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol SpyDelegate { | |
func didFindWeaponOfMassDestruction(found : Bool) | |
} | |
class EnemyBaseVC: UIViewController { | |
let hasWeaponOfMassDescrtruction : Bool = true | |
var delegate : SpyDelegate? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
@IBAction func sendingMessage(_ sender: Any) { | |
// if delegate is nil then the app will crash | |
// so you must do this check | |
if delegate != nil { | |
delegate?.didFindWeaponOfMassDestruction(found: hasWeaponOfMassDescrtruction) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment