因?yàn)橛袑慉PI有改動(dòng),所以小寫一下柔纵,如果以前的一些方法在Swift3.0里沒發(fā)用了,可以去下面這個(gè)官方的API變動(dòng)文檔去看看
var count : UInt32 = 0;
let list = class_copyPropertyList(UIPageControl.classForCoder(),&count)
for i in 0..<count
{
let aa = list?[Int(i)]
let cc = property_getName(aa)
//下面這個(gè)方法就是新加的,刪掉了以前的
//String.fromCString(_: UnsafePointer<CChar>) -> String? [static]
let name = String.init(cString:cc!)
//這樣寫也是同樣的效果
let name1 = String.init(utf8String : cc!)!
print(name)
print(name1)
}