标签:protocol object span style elf hba tin name code
swift中代理的使用
protocol DetailsViewControllerDelegate: NSObjectProtocol{
func fetchBackString(str: String)
}
weak var delegate: DetailsViewControllerDelegate?
class ViewController: DetailsViewControllerDelegate
let VC = segue.destination as! DetailsViewController VC.delegate = self
//MARK: - DetailsViewControllerDelegate(代理) func fetchBackString(str: String) { NSLog(str, "") }
delegate!.fetchBackString(str: "代理返回数据:\(area.name)")
标签:protocol object span style elf hba tin name code
原文地址:http://www.cnblogs.com/Milo-CTO/p/7447656.html