[图片上传中。。。(1)]###swift和function
值类型和引用类型
命名空间(namespace)
oc和swift互相调用
异常处理
如何运用swift开发app
使用tableView实现复杂的界面
AutoLayout使用技巧
高度自适应
segmented Control 的使用
CCmenuItem 这个组件做弹出按钮【类似powerPop】
pickerView 写有关日期选择器
无缝兼容function
string - NSString
int ,float、double 、bool 以及其他与数字有关的类型-NSNumber
Array - NSArray
Dictionary - NSDictionary
Set - NSSet
AnyObject - NSObject
swift原生类型是对Foudation 更好的补充
Swift 基础 - 值类型和引用类型
struct 和enum 定义的类型是值类型,使用class定义的引用类型
基本数据类型全是struct
处理大量数据并且频繁增减元素时,NSMutableArray、NSMutableDictionary 和NSMutableSet ,其他情况Array、Dictionary 和 set好一点。
???
swift语言 输出信息定位错误
在swift中的输出,我们一般可以使用print来输出我们需要的信息,同时我们也是可以通过NSLog()这个方法来进行设置相应的详细的信息的输出。
import Foundation
class Math {
class func max(a:Int ,b:Int) -> Int{
NSLog("错误定位")
if a > b {
return a;
}else{
return b
}
}
}
var maxNum = Math.max(2, b: 3)
print("max is : \(maxNum)") 断点和oc一样。
oc与swift互相调用
oc调用swift
import "(moduleName)"-swift.h
swift 调用oc
动态库: import moduleName
静态库:moduleName-Bridging-Header.h 中引入OC 头文件
















flatMap 就是返回为nil的值过滤掉,而Map没有过滤掉







网友评论