在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
//MARK:-------swift中的typedef-------------- //使用 keyword定义类型别名,相似typedef typealias NSInteger = Int var value : NSInteger = 45 value = 12 print(value); //MARK:-------String-------------- let label = "The width is " let width = 94 var widthLabel = label + String(width) //Swift不支持隐式类型转换。须要显式类型转换 widthLabel += "!" print(widthLabel) //Swift使用\(item)的形式进行字符串格式化 let apples = 3 let oranges = 5 let appleSummary = "I have \(apples) apples." let fruitSummary = "I have \(apples + oranges) pieces of fruit." |
请发表评论