在线时间:8:00-16:00
132-9538-2358
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
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)")
评论
请发表评论