swift block
来源:互联网 发布:hd平板软件市场 编辑:程序博客网 时间:2024/05/21 09:29
B class中:
1. 然后typedef一下这个funcation:
typealias callbackfunc=(selectIndex:Int)->Void
2.var myFunc = callbackfunc?()
3.传递函数 func initBack( mathFunction:(selectIndex:Int)->Void ){
myFunc = mathFunction
}
4.最后回调:
myFunc!(selectIndex: indexPath.row);
A class中写法:
xxx.initBack { (selectIndex) -> Void in
做点啥吧.
}
1. 然后typedef一下这个funcation:
typealias callbackfunc=(selectIndex:Int)->Void
2.var myFunc = callbackfunc?()
3.传递函数 func initBack( mathFunction:(selectIndex:Int)->Void ){
myFunc = mathFunction
}
4.最后回调:
myFunc!(selectIndex: indexPath.row);
A class中写法:
xxx.initBack { (selectIndex) -> Void in
做点啥吧.
}
阅读全文
0 0
- swift block
- swift - block
- swift block
- swift中的block回调
- swift之block
- swift语言的Block
- Swift Block传值
- swift中的block
- ios-block swift-block
- Swift 闭包(block)传值
- swift 使用Block-KVO 框架
- swift中闭包block的使用
- swift语言的学习笔记十(block)
- Swift入坑--block的定义
- swift 之 模仿block 界面传值
- Swift如何实现代理,block传值
- swift之block的循环引用
- Swift中C的Block的调用
- Maven的配置文件pom.xml
- mysql 递归查询
- 笔试编程题总结
- algorithm头文件下的常用函数
- [thinkPHP5项目实战_08]模板分离和URL生成
- swift block
- OOAD初学
- 指针函数与函数指针的区别
- Windows(CRLF)格式与Unix(LF)格式转换
- 打包
- 神经网络NN简单理解以及算法
- 深入理解Java虚拟机(8)-.Class文件格式(七)
- redis 中pipline,mset, mget使用对比
- 使用jquery提供的抛物插件,实现添加商品出现抛物线动画