优惠券VC收到品牌:品牌!来自其parentVIEwController.
现在我想将brand.name传递给CouponFeedbackVC.
CouponVC.swift
var brandname: String!overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad brandname = brand.name}overrIDe func prepare(for segue: UIStoryboardSegue,sender: Any?) { if segue.IDentifIEr == "couponToFeedBack" { if let vc = segue.destination as? CouponFeedbackVC { print(brandname) vc.brandname = self.brandname } }}
在CouponFeedbackVC.swift中
var brandname: String!overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() print("vIEwDIDLoad") print(brandname)} overrIDe func awakeFromNib() { print(brandname) self.vIEw.layoutIfNeeded()}
控制台日志
nilvIEwDIDLoadnilStayUncle
awakeFromNib() – > vIEwDIDLoad() – >准备(为segue 总结
以上是内存溢出为你收集整理的ios – Swift 4:在viewDidLoad之后调用(for segue :)全部内容,希望文章能够帮你解决ios – Swift 4:在viewDidLoad之后调用(for segue :)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)