Swift中页面逆向传值
来源:互联网 发布:如何查mac地址值那个大 编辑:程序博客网 时间:2024/05/16 05:43
A页面 创建按钮,跳到B页面
let btn = UIButton(type: UIButtonType.Custom)self.myBtn = btnbtn.frame = CGRectMake(50, 50, 50, 50)btn.setTitle("nextVC", forState: UIControlState.Normal)btn.addTarget(self, action: "nextVC", forControlEvents: UIControlEvents.TouchUpInside)self.view.addSubview(btn)func nextVC(){ let nextVC = NextViewController() nextVC.nextPara = {(num:Int) -> Void in self.myBtn.setTitle("\(num)", forState: UIControlState.Normal) } self.navigationController?.pushViewController(nextVC, animated: true) }
B页面 返回A页面传值
- 定义闭包
typealias loginClosure = (num:Int)->Void
- 返回按钮
let btn = UIButton(type: UIButtonType.Custom) btn.frame = CGRectMake(50, 100, 100, 50) btn.setTitle("preVC", forState: UIControlState.Normal) btn.addTarget(self, action: "preVC", forControlEvents: UIControlEvents.TouchUpInside) self.view.addSubview(btn)
- 传值
func preVC(){ nextPara(num:12) self.navigationController?.popViewControllerAnimated(true) }
0 0
- Swift中页面逆向传值
- Swift中页面跳转与传值:
- Swift - 页面传值
- swift页面传值
- Swift 闭包页面传值
- Swift之UITableView的增删以及三种逆向传值方式
- swift中tabbar切换页面动画
- block逆向传值
- swift页面传值之block(闭包)传值
- swift UI专项训练42 用Swift代码实现页面跳转与传值
- iOS开发之一篇文章学会页面传值详解 - 十种页面传值方法大全 swift 版本
- jsp中页面传值
- 利用Swift之协议语法实现页面间的传值功能
- APP逆向(中)
- swift页面跳转动画
- Swift学习-页面跳转
- swift 跳转页面
- swift 启动页面
- SecurityContextHolder.getContext().getAuthentication()为null的问题
- nginx学习心得
- 初级使用github
- 第一个uwp程序-- owlGZTV 上架商店
- Andriod GridView不改变背景色实现网格线效果
- Swift中页面逆向传值
- PAM(3)
- The type org.apache.http.Header cannot be resolved. 的解决办法
- 基于WinInet API的HTTP编程
- tomcat+memcache+nginx实现共享
- PAM(4)
- 发布出现的错误
- 检测数据库各实例session分布情况的sql
- 童年生活两三事