//数据源数组
lazy var dataArray: [NSDictionary] = {
var tempArray = [NSDictionary]()
//1.获取plist文件的路径
let path = NSBundle.mainBundle().pathForResource("data2.plist", ofType: nil)
//2.拿到plist文件最外层的数组
//将plist文件转换成OC的数组(前提是plist的最外层是数组)
//参数:plist文件的路径
let plistArray = NSArray.init(contentsOfFile: path!)
return tempArray
}()
//CGSizeMake(1000,100)是最大值
let nameSize = nameStr.boundingRectWithSize(CGSizeMake(1000,100),options: .USesLineFramentOrigin,attributes:[NSFontAttributeName: UIFont.systemFontOfSize(13)],context:nil).size
网友评论