To programmaictlly change the content of app, we need to contect storyboard to a view controller. To do that, we need to create new file call it 'ProductViewController', subclass should UIViewController: Delete some uncessary code, the remain code sh
let label = UILabel(frame:CGRect(x:,y:,width:,height:)); label.text="i am a am a label am a label am a labellabel"; label.font = UIFont.boldSystemFont(ofSize: ) label.font = UIFont.systemFont(ofSize: ) label.textColor=UIColor.cyan label.backgrou
昨天研究了一下苹果近两年新出的Swift语言,感觉学起来并不是很吃力,毕竟自己有过Objective-C的语言功底,所以各方面的属性控件还是一眼就可以认出的,只是Swift的写法与Objective-C写法不同而已,这点还是要花点时间来习惯就好了,下面来看Swift的UILabel的相关属性与写法吧: 注意:刚开始初始化的时候,有语法报错,不必理会,接着往下写就好了 // // ViewController.swift // Swift-UILabel // // Created by l
1. 定义变量 var name = "***" 定义常量 let name ="*****" 2. swift 变量类型 String, Int, Float, Double 3. swift 逻辑操作符 && , ||, ! 4. swift 关系运算符 ==, !=, >=, <= 5. swift storyboard界面元素跟code绑定,右键(button , label什么的),左键按住划线到view, 选择对应