随笔分类 - Swift
摘要:import UIKitimport CoreData@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ applicat
阅读全文
摘要:import UIKitclass ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let image = UIImage.init(named: "111.png"); let
阅读全文
摘要:import UIKitclass ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let button = UIButton(type:.system); button.fra
阅读全文
摘要:let textfiled = UITextField(); textfiled.frame = CGRect.init(x:100,y:250,width:160,height:30); textfiled.borderStyle = UITextBorderStyle.roundedRect;
阅读全文
摘要:let button = UIButton(type:.system); button.frame = CGRect.init(x:100,y:150,width:160,height:30); button.setTitle("SwiftBtton", for: .normal); button.
阅读全文
摘要:let label = UILabel(); label.frame = CGRect(x:100,y:100,width:160,height:30); label.text = "我是SwiftLabel"; label.backgroundColor = UIColor.orange; lab
阅读全文
摘要:var dict1 = [1:"A",2:"B",3:"C",4:"D",5:"E"]; var test1 = ["key1":"你好","key2":"Swift","key3":"正在学习","key4":"字典","key5":"取值"] //根据键去取值 print(test1["
阅读全文
摘要:var numbers = [0,1,2,3,4,5]; var vowels = ["A","E","I","O","U"]; var emptyArr = [Int](); //数组元素的个数 print("数组的长度为:\(numbers.count),\(vowels.count),\(em
阅读全文
摘要://字符串的定义 var string = "Hello,swift"; let string1 = "hello,swift"; let string3 = ""; let string4 = string; print(string); print(string.uppercased());//
阅读全文